[mdlug] dual homed and dual default routes?

Rich Clark rrclark at rrclark.net
Fri Feb 8 08:32:03 EST 2008


On Fri, 8 Feb 2008, Dean Durant wrote:

>
> Hello, I am trying to create a dual homed machine, that routes packets,
> & runs squid.
>
> I had it set up so that eth0 was internal, and eth1 was external.  The
> iptables example that I found that seemed to do what I wanted
> had them switched, so I switched them.   Now for some reason, if the
> internal network is working, I can't ping outside URLs.   I can change
> the default gateway to be the external route, and then I can ping outside
> URLs, but then the internal network stops working.
>
> Should it be easy to ping remote hosts on both the internal network and
> the outside?   Did switching the 2 nics somehow screw things up?   It
> worked before.   My only other choice is to completely reinstall linux
> it seems, then squid, then a kernel that I can recompile to support
> forwarding IP packets.
>
> I thought, if I can only add the right route(s) to my routing table, I
> can fix this.  I could switch the bindings on the nics back, but then the iptables nat doesn't work.
>
> How does the kernel normally know which interface to use when you issue
> a ping, or an http get?   Can I have 2 default gateways?    Why does
> only 1 seem to work at a time?   Here's my routing table so far:
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> host-130-16-128 alpine11        255.255.255.255 UGH   0      0        0 eth1
> 10.10.1.0       directroute.eda 255.255.255.255 UGH   0      0        0 eth0
> 192.9.70.0      *               255.255.255.0   U     0      0        0 eth1
> 10.10.1.0       *               255.255.255.0   U     0      0        0 eth0
> 169.254.0.0     *               255.255.0.0     U     0      0        0 eth1
> default         directroute.eda 0.0.0.0         UG    0      0        0 eth0
> default         alpine11        0.0.0.0         UG    0      0        0 eth1
>
>       Thanks for any help or insight
> anyone can offer.    Dean.

Do you have the following line in /etc/sysctl.conf?

net.ipv4.ip_forward=1

Check that first, as it's the most likely problem. If you do and it's set 
to 0, change it to 1.



More information about the mdlug mailing list