[mdlug] dual homed and dual default routes?
rborromeo at the5spot.com
rborromeo at the5spot.com
Fri Feb 8 08:08:32 EST 2008
You can't have 2 default routes what you will have to do is costing of
routes with route lookup tables.
Look at the man pages for iproute2 it's pretty much baked into any modern
distro it's been a while since I've done it and I think they've improved
since I used it
so the verbage may not be the same anymore. I think it was something like
this-
ip route add default equalize nexthop via gatewayip1 weight 1 dev eth2
nexthop via gatewayip2 weight 1 dev eth1
----- Original Message -----
From: "Dean Durant" <mdlug at sbcglobal.net>
To: <mdlug at mdlug.org>
Sent: Friday, February 08, 2008 6:46 AM
Subject: [mdlug] dual homed and dual default routes?
>
> 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.
> _______________________________________________
> mdlug mailing list
> mdlug at mdlug.org
> http://mdlug.org/mailman/listinfo/mdlug
>
More information about the mdlug
mailing list