Advertisement

need an iptables/nat guru

Started by October 16, 2002 09:53 AM
0 comments, last by SilentReaper 22 years, 3 months ago
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!
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.

This topic is closed to new replies.

Advertisement