multihoming routing question (FC 3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a Fedora Core 3 machine with two ethernet cards, each connected
to a network with a router that can be used as a default route.
Trying to share traffic between the networks, but at the same time
ensure that requests are responded to on the network they came in on,
I'm running the following in rc.local

	# table 1 has rules for network 1
	ip route add XXX.YYY.151.0 dev eth0 src XXX.YYY.151.5 table 1
	ip route add default via XXX.YYY.151.254 table 1
	ip route add 127.0.0.0/8 dev lo table 1

	# table 2 has rules for network 2
	ip route add XXX.YYY.131.0 dev eth0 src XXX.YYY.131.5 table 2
	ip route add default via XXX.YYY.131.254 table 2
	ip route add 127.0.0.0/8 dev lo table 2

	# now use these rules
	ip rule add from XXX.YYY.151.5 table 1
	ip rule add from XXX.YYY.131.5 table 2

I've also changed /etc/sysconfig/network-scripts/ifup,
replacing
	    ip route replace default via ${GATEWAY} ${WINDOW:+window $WINDOW} ${SRC} ${GATEWAYDEV:+dev $GATEWAYDEV}
with
            ip route append default via ${GATEWAY} ${WINDOW:+window $WINDOW} ${SRC} ${GATEWAYDEV:+dev $GATEWAYDEV}
-- otherwise bringing the second interface up replaces the first
default route instead of appending it.

My question is, is this the right way to do this?  I suspect the
routing tables should be set up through /etc/init.d/network and
/etc/sysconfig/static-routes, but I'm not sure of the format of the
latter file, or if it will allow me to set up tables and rules.

I'd also like to avoid modifying ifup if that's possible.

Danny.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux