[PLUG] Routing problem...
Michael Robinson
plug_1 at robinson-west.com
Wed Nov 25 01:58:46 UTC 2009
#!/bin/bash
#
PATH=/sbin
ip route del 192.168.1.0/24
route add -net 192.168.1.0/24 dev eth0 gw 192.168.3.18 metric 1
The above is a script that I use to switch the default gw on
a backside router Dodo.
D ---- W
| |
| |
| |
| |
X------G----LAN
I have Dodo, D, connected to Web, W, and Xerxes, X.
G, goose, is connected to Dodo via 192.168.4.0/28 network. (not shown)
Web is in the 192.168.3.16/28 network.
Xerxes is in the 192.168.3.0/24 network.
Web, Goose, and Xerxes are also in the 192.168.1.0/24 network.
Traditionally, if web and xerxes were on the same subnet,
I might use a virtual IP address and route to it.
I need to route from dodo based on the source the
packet stream came from. When the gateway from the other
end is web, I can route to web from dodo and that will usually
be correct. It won't be correct to route packets to web if I
try to run horde on xerxes though.
The correct route can't be determined until I know which machine,
web or xerxes, is trying to go through dodo. Yikes, how do I go
about figuring this out and untangling this ugly mess? I literally
need to change the route to get to the 192.168.1.0/24 network from
dodo on the fly. I haven't even talked about tracking gateway
outages on web and xerxes. The above script has a sister script
that switches to the other router and I run these scripts via cron,
but that isn't a very robust approach.
I think I need to have 2 routing tables, the original one and a second
one, with the 2 routes to reach 192.168.1.0/24. I then need to MARK
packet streams going through dodo based on which server by MAC address
the packets originate from.
More information about the PLUG
mailing list