ip addr flush dev <device> secondary does not work properly.

Solution Verified - Updated -

Environment

  • Red Hat Enterprise LInux 6
  • iproute2(includes ip command)

Issue

ip addr flush dev &lt;device&gt; secondary does not work properly.

Even if "ip addr flush secondary" runs, the secondary IP addresses are not deleted.

# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
  link/ether 52:54:00:3c:c1:e7 brd ff:ff:ff:ff:ff:ff
  inet 10.64.207.128/23 brd 10.64.207.255 scope global eth0
  inet 10.64.207.127/23 scope global secondary eth0
  inet 10.64.207.126/23 scope global secondary eth0

# ip addr flush dev eth0 secondary

# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
  link/ether 52:54:00:3c:c1:e7 brd ff:ff:ff:ff:ff:ff
  inet 10.64.207.128/23 brd 10.64.207.255 scope global eth0
  inet 10.64.207.127/23 scope global secondary eth0
  inet 10.64.207.126/23 scope global secondary eth0

Resolution

This bug is fixed by iproute-2.6.32-16.el6.

For details, refer to https://access.redhat.com/errata/RHBA-2011:0757

Root Cause

  • This is a bug : see (Bugzilla 678986)[https://bugzilla.redhat.com/show_bug.cgi?id=678986]. The commit: 3bc1c4f29777171b484d36abf673667e3729202b contains the fix.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.