routing question (almost there!)
Paul Howarth
paul at city-fan.org
Wed Feb 9 08:07:27 UTC 2005
On Tue, 2005-02-08 at 16:21 -0500, Douglas Frank wrote:
> Oops yes it is. Anyway I'm past that (see earlier post)-- the box I
> *thought* was the router, isn't.
>
> I'm almost all set-- I just need to know how to make the routing table
> permanent. Looking at /etc/rc.d/rc5.d/S10network, it reads a static-
> routes file (if present) and adds routes found there. Looks like all
> I have to do is gin up a file for it to read. Unfortunately the rc
> script dosn't allow the arguments I think I need:
>
> the rc script invokes route sort of like this:
>
> cat static_routes | while read ignore args ; do
> /sbin/route add -$args
> done
Rumour has it that the static-routes file is deprecated (at least that's
what it says at http://www.linuxhomenetworking.com/linux-hn/appendix-
diff.htm and http://www.linuxhomenetworking.com/linux-hn/dchp.htm and
also mentioned at https://bugzilla.redhat.com/bugzilla/show_bug.cgi?
id=108696).
> The lines I *want* to generate to route are:
>
> route add -net <router's_network> netmask 255.255.255.0 eth0
> route add default gw <router_1>
> route add default gw <router_2>
>
> but the darn '-' in the script gets in the way of the 2nd & 3rd lines,
> route(8) doesn't like "-default". (The local network router doesn't
> have an address on the local net. Beats me! The switches around here
> are a madhouse.)
>
> What's the trick? (Yes I could edit the rc script but would rather not).
Hmm, multiple default routes, that's unusual. Are you sure that's what
you really want and not:
default route via router0
route to otherlan1/prefix1 via router1
route to otherlan2/prefix2 via router2
You'd set this up as follows:
1. Add a line:
GATEWAY=router0-IP
to /etc/sysconfig/network
2. Add lines:
otherlan1/prefix1 via router1-IP
otherlan2/prefix2 via router2-IP
e.g.
16.47.32.0/24 via 16.140.160.1
16.32.176.0/24 via 16.140.160.2
to /etc/sysconfig/network-scripts/route-eth0
If you really do need multiple default routes, a non-Fedora-specific
guide to handling routing for multiple uplinks/providers can be found
at: http://lartc.org/howto/lartc.rpdb.multiple-links.html
Paul.
--
Paul Howarth <paul at city-fan.org>
More information about the fedora-list
mailing list