I''m trying to use ip route to setup a single interface with two ip addresses. I currently have: / # /usr/sbin/ip address show 1: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:19:03:00:27:10 brd ff:ff:ff:ff:ff:ff inet 128.0.0.1/16 brd 128.0.255.255 scope global eth0:1 inet 172.17.31.84/24 brd 172.17.31.255 scope global eth0 2: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo / # /usr/sbin/ip route 172.17.31.0/24 dev eth0 proto kernel scope link src 172.17.31.84 128.0.0.0/16 dev eth0 proto kernel scope link src 128.0.0.1 default via 172.17.31.1 dev eth0 / # /usr/sbin/ip route show table local broadcast 172.17.31.255 dev eth0 proto kernel scope link src 172.17.31.84 broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1 broadcast 128.0.0.0 dev eth0 proto kernel scope link src 128.0.0.1 local 128.0.0.1 dev eth0 proto kernel scope host src 128.0.0.1 broadcast 172.17.31.0 dev eth0 proto kernel scope link src 172.17.31.84 broadcast 128.0.255.255 dev eth0 proto kernel scope link src 128.0.0.1 local 172.17.31.84 dev eth0 proto kernel scope host src 172.17.31.84 broadcast 127.0.0.0 dev lo proto kernel scope link src 127.0.0.1 local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1 local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1 What I''d like is to have it so that the src address is always 172.17.31.84 for both 172.17.31.0/24 & 128.0.0.0/16. So I modify the routes to get: / # /usr/sbin/ip route show 172.17.31.0/24 dev eth0 proto kernel scope link src 172.17.31.84 128.0.0.0/16 dev eth0 proto kernel scope link src 172.17.31.84 default via 172.17.31.1 dev eth0 however if the dest is 128.0.0.1 the src is still 128.0.0.1: / # /usr/sbin/ip route get 128.0.0.1 local 128.0.0.1 dev lo src 128.0.0.1 cache <local> mtu 16436 advmss 16396 metric 10 64 Is there any way to modify the routes so this ''loopback'' src becomes 172.17.31.84? I''m running a 2.6.20 kernel. thanks - kumar
On Tue, Mar 06, 2007 at 16:32:50 -0600, Kumar Gala <galak@kernel.crashing.org> wrote:> > What I''d like is to have it so that the src address is always 172.17.31.84 > for both 172.17.31.0/24 & 128.0.0.0/16.ip addr add dev eth0 172.17.31.84/24 ip addr add dev eth0 172.17.31.84 peer 128.0.0.0/16
Alexandre J. Correa - Onda Internet
2007-Mar-07 20:12 UTC
2 links web going out by link1.. rest by link2
Hello !! On my linux gateway i have 2 adsl connections. how I make traffic that leaves to port 80 has left on link1 and the remaining left on link2 ? without marking packets with iptables... it´s possible ?! Thanks ! -- Sds. Alexandre J. Correa Onda Internet www.ondainternet.com.br Linux User ID #142329