[mdlug] dual homed and dual default routes?

Dean Durant mdlug at sbcglobal.net
Fri Feb 8 06:46:51 EST 2008


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. 



More information about the mdlug mailing list