FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 11-16-2011, 06:48 PM
Dale Dellutri
 
Default Where is source address info of a route kept?

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?

--
Dale Dellutri
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 11-16-2011, 07:00 PM
"Mike Burger"
 
Default Where is source address info of a route kept?

> 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@bubbanfriends.org
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 11-16-2011, 07:11 PM
Marcelo Beckmann
 
Default Where is source address info of a route kept?

Em 16-11-2011 17:48, Dale Dellutri escreveu:
> 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?
>

ip route uses NETLINK to obtain info


I did:
strace -o /tmp/strace.out ip route show

and inside strace.out:
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
sendto(3, "2422103125304N", 20, 0,
{sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000},
msg_iov(1)=[{"36420200125304N"
431I1"...,
16384}], msg_controllen=0, msg_flags=0}, 0) = 1688


You can see /proc/net/rt_cache, there is a Source column there.



--
Marcelo Beckmann
Suporte Corporativo - suporte@webers.com.br
Webers Tecnologia - http://www.webers.com.br
Curitiba (PR) (41) 3094-6600
Rio de Janeiro (RJ) (21) 4007-1207
São Paulo (SP) (11) 4007-1207
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 04:17 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org