Hi, I'm trying to set up routing tables for 2 connecting through 2
different ISP's. I see the document on
http://www.lartc.org/lartc.html, but I can't seem to get it to work.
I have have a question about what $P1_NET, $P2_NET would be. My first
guess would be something like 192.168.1.0/24 for local 256 node subnet
that P1 is on. But, if you think about it in broader terms couldn't
it be 255.255.255.255/0? Are there any examples with real numbers?
Thanks.
4.2.1. Split access
The first is how to route answers to packets coming in over a
particular provider, say Provider 1, back out again over that same
provider.
Let us first set some symbolical names. Let $IF1 be the name of the
first interface (if1 in the picture above) and $IF2 the name of the
second interface. Then let $IP1 be the IP address associated with $IF1
and $IP2 the IP address associated with $IF2. Next, let $P1 be the IP
address of the gateway at Provider 1, and $P2 the IP address of the
gateway at provider 2. Finally, let $P1_NET be the IP network $P1 is
in, and $P2_NET the IP network $P2 is in.
One creates two additional routing tables, say T1 and T2. These are
added in /etc/iproute2/rt_tables. Then you set up routing in these
tables as follows:
ip route add $P1_NET dev $IF1 src $IP1 table T1
ip route add default via $P1 table T1
ip route add $P2_NET dev $IF2 src $IP2 table T2
ip route add default via $P2 table T2