Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi All,
I need help in configuring iptables.
I have a gentoo server with eth0 (Public network interface) and eth1 (internal LAN interface).
I have to listen to a socket on eth0 and forward all the incoming tcp conections(New, established, related) to a host connected to eth1.
The following are the iptables rules;
iptables -t nat -A PREROUTING -p tcp -i eth0 -d 10.184.19.28 --source 167.156.144.179 --dport 13566 -j DNAT --to-destination 8.8.8.1:18562
iptables -A FORWARD -p tcp -i eth0 -o eth1 -d 8.8.8.1 --dport 18562 -j ACCEPT
iptables -A FORWARD -p tcp -i eth1 -o eth0 -j ACCEPT
iptables -t nat -A POSTROUTING -p tcp -o eth1 -d 8.8.8.1 --dport 18562 -j SNAT --to-source 10.184.19.28:15460
I face this issue.
When a new incoming connection on eth0 is received, the iptables rules can successfully forward the SYN to my host in the LAN and the host successfully replies with a SYNACK.
However, my gentoo box, on receiving SYNACK, terminates the connection with RST.
Your Gentoo box is the one providing NAT services, then?
I haven't done NAT on GNU/Linux, but my WAG is you need an explicit ESTABLISHED,RELATED rule. Otherwise, the NAT server sees at as an unwanted, unsolicited packet.
By my liking it is completely wrong. Why you need NAT for this IP/port?
Actually RST to SYN/ACK is expected behaviour and your IPtables rules actually allows kernel to send RST in response to unsolicited SYN/ACK (it is unsolicited SYN/ACK, because of your weird NAT).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.