Answer the question
In order to leave comments, you need to log in
Is it possible to pass guest ip to local machine?
OS Debian 8, pure-ftpd - server, all vps - openvz containers.
There is an ftp server on vps2 with a local ip , there is a vps1 with a real ip where traffic is redirected (using iptables) to the desired local ip.
When connecting to an ftp server (with local ip), only external ip information (with vps1 ) is written in the logs, but information about the client's ip (not vps1 itself ) is needed.
Is it possible to somehow pass the client's ip to the vps2 logs ?
UPD1: I am
redirecting now according to this rule:
iptables -t nat -A PREROUTING --dst %YOU_PUBLIC_ADDRESS% -p tcp -m multiport --dport 21,50000:51000 -j DNAT --to-destination 192.168.10.10
iptables -t nat -A POSTROUTING --dst 192.168.10.10 -p tcp -m multiport --dport 21,50000:51000 -j SNAT --to-source %YOU_PUBLIC_ADDRESS%
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -I FORWARD 1 -i venet0 -o venet0 -d 192.168.10.10 -p tcp -m multiport --dport 21,50000:51000 -j ACCEPT
Answer the question
In order to leave comments, you need to log in
I don’t know how port forwarding works for you there, but with normal settings, the internal server sees the IPs from the outside
With classic nat translation, this information cannot be transmitted (in the same way, your local address cannot be transmitted outside with src nat - this is the meaning and essence of the technology).
In other protocols (for example, http and its proxy), a protocol extension is used for this purpose.
But of course you need to look at what kind of software you have there, there are types of NAT that allow you to pass addresses of public hosts through yourself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question