Hello
I have a server at home and one very small server in a datacenter.
I use iptables with NAT to forward the server in the datacenter to my server at home.
The problem is, when I want to forward the port 25. It's work when I use this rule :
Code:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
But, with this rule, all input traffic use the datacenter server's IP (For example, I can't see my IP in the access.log, but I see the datacenter server's IP)
When I use this iptables rule, all seems to work:
Code:
iptables -t nat -A POSTROUTING -s MY_HOME_IP -o eth0 -j MASQUERADE
The HTTP traffic work, IMAP, POP too, but not the SMTP traffic : I get a connection refused
I use theses iptables rules to forward ports to my home server's IP address :
Code:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport <PORT> -j DNAT --to <MY_HOME_IP>:<PORT>
I think the packet is lost because it never reach the mail server.
Thanks for any help !