Archived

This topic is now archived and is closed to further replies.

need an iptables/nat guru

This topic is 5539 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I set up a basic NAT box lastnight using RedHat 7.2, default kernel (2.4.18-3). I''m looking for a way to forward all traffic (tcp&udp/ip) that does not specifically already have a ruleset to a certain IP on my network. Network configuration: Linux box eth0 = internal IP - 192.168.0.2 eth1 = external IP - DHCP (cable modem) Internal server 1 - 192.168.0.1 Workstation 1 - 192.168.0.200 ... So, some ports are already set to forward to the internal server, and that''s all working fine. But I would like to forward all other ports that aren''t specifically entered in iptables to forward to the workstation. My router I was using up until yesterday did have a way to forward all tcp traffic to an internal IP, but it seems it didn''t forward udp as well, so just looking for the specific command to do this. Thanks in advance!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Since iptables just checks each rule in the table in order against the packets, just create one last rule - something like "iptables -A PREROUTING -t nat -i eth1 -j DNAT --to 192.168.0.200" - and make sure it stays last.

Share this post


Link to post
Share on other sites