[libdnet-devel] How to interpret libdnet's route objects?
Status: Abandoned
Brought to you by:
dugsong
|
From: Ryan L. <rya...@gm...> - 2009-03-23 16:06:25
|
The route listing reported by Libdnet's 'route' object doesn't completely
match any of my routing tables. It reports a partial subset of routing
table #0, the "unspec" table, but it's missing the IPv4 'local',
'broadcast', and link-local routes. Is dnet supposed to work this way? I'm
used to iproute2, and it seems like there are a few differences between that
and the model that 'dnet' uses.
I'm running Fedora 10 (kernel
2.6.27.19-170.2.35_1.cubbi_tuxonice.fc10.i686), with Libdnet 1.12 via RPM.
I originally noticed this behavior in the Python bindings, but I've
confirmed it using 'dnet' test utility. I've attached the various outputs
from 'dnet', 'ip route', etc. below, for reference.
If I'm just misunderstanding this, please let me know--I would appreciate
the education.
Thanks,
Ryan
=====
To start with, here's how my interfaces are configured:
{{{
[ryan.b.lynch@caffeine ~]$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:0e:35:b3:aa:a7 brd ff:ff:ff:ff:ff:ff
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state
UP qlen 1000
link/ether 00:11:43:65:e5:b5 brd ff:ff:ff:ff:ff:ff
inet 10.163.96.86/24 brd 10.163.96.255 scope global eth0
inet 10.163.96.87/24 brd 10.163.96.255 scope global secondary eth0:0
inet 10.163.96.88/24 brd 10.163.96.255 scope global secondary eth0:1
inet6 fe80::211:43ff:fe65:e5b5/64 scope link
valid_lft forever preferred_lft forever
4: pan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
link/ether 12:b6:b7:36:9d:7e brd ff:ff:ff:ff:ff:ff
}}}
And here's the output of the 'dnet' utility:
{{{
[ryan.b.lynch@caffeine ~]$ dnet route show
Destination Gateway
0.0.0.0/0 10.163.96.6
::/96 ::
::ffff:0.0.0.0/96 ::
2002:a00::/24 ::
2002:7f00::/24 ::
2002:a9fe::/32 ::
2002:ac10::/28 ::
2002:c0a8::/32 ::
2002:e000::/19 ::
3ffe:ffff::/32 ::
fe80::/64 ::
::/0 ::
::1 ::
fe80::211:43ff:fe65:e5b5 ::
ff00::/8 ::
::/0 ::
}}}
Contrast that with the contents of the "main" routing table, #254 (same as
shown by :
{{{
[ryan.b.lynch@caffeine ~]$ ip route show
10.163.96.0/24 dev eth0 proto kernel scope link src 10.163.96.86
169.254.0.0/16 dev eth0 scope link metric 1003
default via 10.163.96.6 dev eth0
}}}
Using the older utility:
{{{
[ryan.b.lynch@caffeine ~]$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
10.163.96.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth0
2.0.0.0 10.163.96.1 255.0.0.0 UG 0 0 0 eth0
0.0.0.0 10.163.96.6 0.0.0.0 UG 0 0 0 eth0
}}}
The "unspec" routing table, #0, does show all of the routes that 'dnet'
lists, plus more:
{{{
[ryan.b.lynch@caffeine ~]$ ip route show table 0
10.163.96.0/24 dev eth0 proto kernel scope link src 10.163.96.86
169.254.0.0/16 dev eth0 scope link metric 1003
default via 10.163.96.6 dev eth0
broadcast 10.163.96.0 dev eth0 table local proto kernel scope link src
10.163.96.86
broadcast 127.255.255.255 dev lo table local proto kernel scope link src
127.0.0.1
local 10.163.96.87 dev eth0 table local proto kernel scope host src
10.163.96.86
local 10.163.96.86 dev eth0 table local proto kernel scope host src
10.163.96.86
broadcast 10.163.96.255 dev eth0 table local proto kernel scope link src
10.163.96.86
local 10.163.96.88 dev eth0 table local proto kernel scope host src
10.163.96.86
broadcast 127.0.0.0 dev lo table local proto kernel scope link src
127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src
127.0.0.1
unreachable ::/96 dev lo metric 1024 error -101 mtu 16436 advmss 16376
hoplimit 4294967295
unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -101 mtu 16436
advmss 16376 hoplimit 4294967295
unreachable 2002:a00::/24 dev lo metric 1024 error -101 mtu 16436 advmss
16376 hoplimit 4294967295
unreachable 2002:7f00::/24 dev lo metric 1024 error -101 mtu 16436 advmss
16376 hoplimit 4294967295
unreachable 2002:a9fe::/32 dev lo metric 1024 error -101 mtu 16436 advmss
16376 hoplimit 4294967295
unreachable 2002:ac10::/28 dev lo metric 1024 error -101 mtu 16436 advmss
16376 hoplimit 4294967295
unreachable 2002:c0a8::/32 dev lo metric 1024 error -101 mtu 16436 advmss
16376 hoplimit 4294967295
unreachable 2002:e000::/19 dev lo metric 1024 error -101 mtu 16436 advmss
16376 hoplimit 4294967295
unreachable 3ffe:ffff::/32 dev lo metric 1024 error -101 mtu 16436 advmss
16376 hoplimit 4294967295
fe80::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit
4294967295
unreachable default dev lo table unspec proto none metric -1 error -101
hoplimit 255
local ::1 via :: dev lo table local proto none metric 0 mtu 16436 rtt
0.00ms rttvar 0.00ms cwnd 3 advmss 16376 hoplimit 4294967295
local fe80::211:43ff:fe65:e5b5 via :: dev lo table local proto none
metric 0 mtu 16436 advmss 16376 hoplimit 4294967295
ff00::/8 dev eth0 table local metric 256 mtu 1500 advmss 1440 hoplimit
4294967295
unreachable default dev lo table unspec proto none metric -1 error -101
hoplimit 255
}}}
|