[nmglug] iptables / routing question,

Gary Sandine gars at laclinux.com
Tue Dec 12 21:53:48 PST 2006


On Tue, 2006-12-12 at 11:05 -0700, Andres Paglayan wrote:
> I am trying to route all incoming trafic in eth0 (192.168.1.1)  
> directed to 192.168.50.0/24 through eth2 (192.168.50.1)
> 
> 
> I did:
> 
> route add -net  192.168.50.0/24  gw 192.168.50.1
> 
> and my route -n looks like
> 
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref     
> Use Iface
> 10.12.223.2     0.0.0.0         255.255.255.255 UH    0      0         
> 0 tun0
> 192.168.50.0    192.168.50.1    255.255.255.0   UG    0      0         
> 0 eth2
> 192.168.50.0    0.0.0.0         255.255.255.0   U     0      0         
> 0 eth2
> 192.168.2.0     0.0.0.0         255.255.255.0   U     0      0         
> 0 eth1
> 192.168.1.0     0.0.0.0         255.255.255.0   U     0      0         
> 0 eth0
> 65.19.28.0      0.0.0.0         255.255.255.0   U     0      0         
> 0 eth3
> 10.12.223.0     10.12.223.2     255.255.255.0   UG    0      0         
> 0 tun0
> 0.0.0.0         65.19.28.1      0.0.0.0         UG    0      0         
> 0 eth3

Whoa.

[..]
> I can ping 192.168.50.254 host from within the router,
> but I cannot from any other pc in the subnet.
> 
> I think I should add an iptables fordwarding
> (the iptables at this host is fairly complex and my guess is the  
> traffic is being dropped somewhere)

If there's no iptables rule prohibiting this, maybe this will be enough:

echo 1 > /proc/sys/net/ipv4/ip_forward

I'd like to know... :)

What's there before you do that?

cat /proc/sys/net/ipv4/ip_forward






More information about the nmglug mailing list