split routing / policy routing

Linux Advanced Routing and Traffic Control

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

 



Hi,

my situation is the following:

A debian box connected to my modem, sporting two nics, eth0 and eth1.
Two pppoe connections are running through eth0, ppp1 and ppp2. ppp1
gets a static IP, while ppp2 gets a dynamic IP. Both are using
different accounts from the same ISP.

eth1 is connected to a switch which connects the local network to it.
The debian box runs dnsmasq to act as dhcp server. eth1's IP is
192.168.2.1.

My goal is to have the debian box, which among others runs a
webserver, be reachable through the static IP (ppp1), while the
devices in the local network are supposed to connect to the internet
with a dynamic IP (ppp2).

I set ppp1 as default in the main table. I am able to route a certain
IP (call it "Claire") from my local network through ppp2 as described
in http://lartc.org/howto/lartc.rpdb.html#LARTC.RPDB.SIMPLE .

However, I want to route the whole subnet through there. But when I
replace Claire's IP with 192.168.2.0/24, my devices lose connection to
the internet and to 192.168.2.1.

Of course I looked at
http://lartc.org/howto/lartc.rpdb.multiple-links.html , since it
pretty much describes my situation (2 different providers, although I
only have two accounts at the same provider). BUT it uses an approach
a bit different from the former setup, requiring the interfaces' IPs.
Since ppp2 gets a dynamic IP though, I cannot set it up like that. Or can I?

Also my $P1_NET and $P2_NET are the same.

What would be an approach to either use a subnet in the first setup,
or use the second setup without having to specify the devices (ppp2's)
IP address? After all, ppp2's IP address still appears in the src of
the main table's routes.

My current outputs:

~$ sudo ip rule list
0:      from all lookup local
32763:  from 192.168.2.0/24 lookup Homenet
32764:  from 192.168.2.239 lookup Claire
32766:  from all lookup main
32767:  from all lookup default

~$ sudo ip route list table Claire
default via 168.95.98.254 dev ppp2  # this one works! the same on
table Homenet works not.

~$ sudo ip route list
default dev ppp1  scope link
168.95.98.254 dev ppp2  proto kernel  scope link  src xx.xxx.170.105
168.95.98.254 dev ppp1  proto kernel  scope link  src xxx.xx.85.229
192.168.2.0/24 dev eth1  proto kernel  scope link  src 192.168.2.1



thanks
--
To unsubscribe from this list: send the line "unsubscribe lartc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux