我有一台用iptables做nat的服务器,然后应用服务器(非http)放在nat服务器之后,iptables有没有办法把源IP传递给应用服务器?
iptables规则如下,12.23.56.78 是服务器的公网IP
iptables -t nat -A PREROUTING -p tcp -d 12.23.56.78 --dport 80 -j DNAT --to-destination 192.168.1.100
iptables -t nat -A POSTROUTING -j MASQUERADE
http可以通过x-forword-for传递源IP,ip层面是否有相应的解决方案?
iptables规则如下,12.23.56.78 是服务器的公网IP
iptables -t nat -A PREROUTING -p tcp -d 12.23.56.78 --dport 80 -j DNAT --to-destination 192.168.1.100
iptables -t nat -A POSTROUTING -j MASQUERADE
http可以通过x-forword-for传递源IP,ip层面是否有相应的解决方案?