Q: iproute2 & multiple IPs on 1 interface

Fraser Campbell fraser-eicrhRFjby5dCsDujFhwbypxlwaOVQ5f at public.gmane.org
Thu Mar 25 20:24:39 UTC 2004


On Thursday 25 March 2004 00:55, S P Arif Sahari Wibowo wrote:

> here are the iproute2 informations:
>
> # ip route show
> 202.202.202.200/29 dev eth1  scope link
> 101.101.101.96/29 dev eth0  scope link
> 127.0.0.0/8 dev lo  scope link
> default via 101.101.101.102 dev eth0
>
> # ip rule show
> 0:      from all lookup local
> 32765:  from 202.202.202.200/29 lookup 8
> 32766:  from all lookup main
> 32767:  from all lookup 253
>
> # ip route show table 8
> default via 202.202.202.206 dev eth1
>
> # ip address show dev eth1
> 3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
>     link/ether 00:40:f4:50:21:18 brd ff:ff:ff:ff:ff:ff
>     inet 202.202.202.201/29 brd 202.202.202.207/29 scope global eth1
>     inet 202.202.202.202/29 brd 202.202.202.207/29 scope global secondary
> eth1:0
>
> Now, I can access the IP 202.202.202.201 from external machine, but I
> cannot access the IP 202.202.202.202. Trial to connect to 202.202.202.202
> will just hang there, waiting for answer that never come.

Are you testing from another machine which is connected to the 
202.202.202.202/29 network or are you connecting from a remote site?  One 
problem that I see is that you have no rules to handle local routing.

I think that your rules should look something like this:

0:        from all lookup local
100:      ffrom all to 202.202.202.200/29 lookup main
32765:  from 202.202.202.200/29 lookup 8
32766:  from all lookup main
32767:  from all lookup 253

The rule at priority 100 tell the machine to route packets destined for the 
local network using the main routing table.  Without these rules traffic 
destined for other machines on that network will go to the router (which may, 
or may not be kind enough to forward the packets back onto the LAN ... more 
likely it will send a redirect that will be useless because of your routing 
rules).

If that's not it then did you remember to run "ip route flush cache" after the 
last changes that you made?  This definitely works so keep at it and you will 
find success.

-- 
Fraser Campbell <fraser-Txk5XLRqZ6CsTnJN9+BGXg at public.gmane.org>                 http://www.wehave.net/
Georgetown, Ontario, Canada                               Debian GNU/Linux
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list