> I have an ethernet device in my lan with a primary address 192.168.5.205 > and a secondary address .217. I added the secondary address after network > startup established the primary address by an ip addr add command: > > # ip addr add 192.168.5.217/24 broadcast 192.168.5.255 dev eth0 > > # ip addr show > ... > 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen > 1000 > link/ether 78:2b:cb:23:21:4c brd ff:ff:ff:ff:ff:ff > inet 192.168.5.205/24 brd 192.168.5.255 scope global eth0 > inet 192.168.5.217/24 brd 192.168.5.255 scope global secondary eth0 > inet6 fe80::7a2b:cbff:fe23:214c/64 scope link > valid_lft forever preferred_lft forever > ... > > Then I add a new route via a network gateway but I want the route to use > the secondary address as a source. > > # ip route add 11.11.11.11 via 192.168.5.148 src 192.168.5.217 > > And the ip route show command shows that it knows the source. > > # ip route show > 11.11.11.11 via 192.168.5.148 dev eth0 src 192.168.5.217 > > But where is the source address kept? If I look at /proc/net/route, > it shows the route (0B0B0B0B = 11.11.11.11), but not the source > address. > > # cat /proc/net/route > Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window > IRTT > eth0 0B0B0B0B 9405A8C0 0007 0 0 0 FFFFFFFF 0 0 0 > ... > > Where is the source address kept? It's not kept anywhere, statically. You have two IPs on the same interface within the same subnet, one listed as primary, one as secondary. The routing subsystem is using the primary IP as the source. -- Mike Burger http://www.bubbanfriends.org Visit the Dog Pound II BBS telnet://dogpound2.citadel.org or http://dogpound2.citadel.org To be notified of updates to the web site, visit: https://www.bubbanfriends.org/mailman/listinfo/site-update or send a blank email message to: site-update-subscribe at bubbanfriends.org