ip addr show not showing all addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

"ip addr show" is not showing all addresses in Linux 2.6.22.1. In 2.6.21.5 it
is working as expected. I have tried it with iproute2-2.6.22-070710,
iproute2-2.6.20-070313, iproute2-2.6.19-061214 and iproute2-2.6.11-050330, all
the same.

Example:

# ip route show dev eth0 | wc -l
3

# ip addr show dev eth0 | wc -l
3

# for i in $(seq 0 255); do
	ip addr add 10.123.$i.1/24 dev eth0
done

# ip route show dev eth0 | wc -l
259

259 means that the addresses were added successfully. Also when I run the
above for-cycle again, I get "RTNETLINK answers: File exists" 256 times. OK.

# ip addr show dev eth0 | wc -l
74

Not OK, expected number is 259.

I thought that I could list all addresses using "ip addr show dev eth0 to
PREFIX", but no luck:

# for i in $(seq 0 16 255); do
	echo -n "$i: "
	ip addr show dev eth0 to 10.123.$i.0/20 | wc -l
done

0: 17
16: 17
32: 17
48: 17
64: 8
80: 0
96: 0
112: 0
128: 0
144: 0
160: 0
176: 0
192: 0
208: 0
224: 0
240: 0

It should be "64: 17", ..., "240: 17".

How can I list all ip addresses on given interface in Linux 2.6.22.1?

--
Martin Volf



-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux