[CentOS] Routing w/ Two Interfaces

Mon Jun 19 01:04:58 UTC 2006
Joshua Gimer <jgimer at gmail.com>

IP routing should be turned off by default. You will also need to edit your
/etc/sysctl.conf file so that the line that reads:

net.ipv4.ip_forward=0 reads net.ipv4.ip_forward=1

This will enable IP forwarding on all interfaces; if you want to enable it
on just one interface then you will need to remove the previously stated
line and add a line in /etc/sysctl.conf that reads:

net.ipv4.conf.<interface>.forwarding=1 ## Replacing interface with the
appropriate interface (ex. eth0).

I also want to remind you that enabling ip routing on any interface is a
security risk, so be warned.

Also look out for the response from my friend Eric Davis, he is explicitly
looking into this just for you; so if you still have issues maybe he can
provide some insight.

On 6/18/06, Fabian Arrotin <fabian.arrotin at arrfab.net> wrote:
>
> Hummh, maybe the following question may seem silly, but have you enabled
> ip routing on your CentOS box ?
> What's the result of cat /proc/sys/net/ipv4/ip_forward ?
> If you have enabled ip routing , maybe have a look at your firewall
> rules to be sure that you don't drop any packets ...
>
> On Sun, 2006-06-18 at 15:06 -0400, Michael B Allen wrote:
> > I have two interfaces on a centos machine with IPs 192.168.2.15 and
> > 192.168.3.15. The routing table is:
> >
> > # route
> > Kernel IP routing table
> > Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface
> > 192.168.3.0     *               255.255.255.0   U     0      0        0
> eth1
> > 192.168.2.0     *               255.255.255.0   U     0      0        0
> eth0
> > 169.254.0.0     *               255.255.0.0     U     0      0        0
> eth1
> > default         192.168.2.1     0.0.0.0         UG    0      0        0
> eth0
> >
> > The gateway 192.168.2.1 is a wireless router on which I have a static
> > route for 192.168.3.0/24 to 192.168.2.15.
> >
> > The problem is I cannot communicate between these networks. If I ping
> > from a machine on 192.168.2.0 to a machine on 192.168.3.0 it never makes
> > it. If I run tcpdump -i eth0 on the machine with two nics, I can see the
> > ICMP packets coming in so I know the static route on the wireless router
> > is working. If I run tcpdump -i eth1 I cannot see the ICMP packets. So
> the
> > routing is wrong. I can successfully ping the machine on the 192.168.3.0
> > network from the machine with two interfaces.
> >
> > I would think that a packet sent from 192.168.2.100 for 192.168.3.128
> > would go to the gateway, get sent to 192.168.2.15 which it would go
> > though the above listed routing table, match 192.168.3.0 and get sent
> > to eth1. What am I doing wrong?
> >
> > Mike
> >
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (GNU/Linux)
>
> iD8DBQBElaynnVkHo1a+xU4RAsomAJ9rk3Sv0llEQA3nOH4W0E8Z4JuxBACcD2Wb
> M4CTUmS5yAmfik1STh7PZu4=
> =NdNn
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
>
>


-- 
Thx
Joshua Gimer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20060618/e734610c/attachment-0005.html>