Re: iptables help

From: Juha Laiho (Juha.Laiho_at_iki.fi)
Date: 10/13/03


Date: Mon, 13 Oct 2003 15:12:01 GMT

grafyt <vze2bd6u@verizon.net> said:
>installed redhat 9 on a machine to use as a gateway for a small home
>lan... read the manual but am confused as to how to set up iptables to
>allow traffic through the linux box for a couple of windows boxes
...
>eth0 is the nic connected to the internal lan and eth1 is connected to
>the dsl modem... using ip addresses 192.168.0.1 through 192.168.0.1 (
>may add more machines later )

Some confusion apparently -- the following line should be everything
you need in iptables:
iptables -t nat -I POSTROUTING -o eth1 -j MASQUERADE

Then the other thing; your machine apparently needs to be configured to
route packages between interfaces. I think on RH9 this should be done by
adding line "net.ipv4.ip_forward=1" to file /etc/sysctl.conf .

You can bring this change immediately into effect with command
sysctl -w net.ipv4.ip_forward=1

-- 
Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
         PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)


Relevant Pages

  • Re: How to Lookup NAT Mapping?
    ... >> Sorry for the confusion. ... namely controlling such connections before they are being initiated, ... iptables is versatile and powerful enough), again if this is not suffi- ... Anyways, I'm sure we'll get You back up the road, Jack. ...
    (comp.os.linux.networking)
  • Re: Blocked UDP Addresses---iptables result
    ... What version if Ubuntu do you use? ... no -l option to iptables. ... And the second confusion is the firewall name. ...
    (Ubuntu)