Flushing addresses with ip address flush is the fast way to clear matching runtime addresses from a Linux interface when it needs to be returned to a clean operating state. This is broader than deleting one address and should be reserved for cases where removing every matching address is the real goal.

The flush action removes every address that matches the selector from the target interface. It is safer to name the interface and narrow the match with a filter such as scope global than to use a broad device-only flush.

Because the effect is broad, it is best to inspect the interface first and limit the scope with a device name, scope, or address family whenever possible. This changes only the running kernel state, so persistent network configuration must still be fixed separately if those addresses would be recreated later.

Steps to flush IP addresses from an interface with ip address:

  1. Review the current addresses on the target interface before removing anything.
    $ ip address show dev lab0
    12: lab0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1400 qdisc noqueue state UNKNOWN group default qlen 1000
        link/ether ea:05:5e:f8:fb:e7 brd ff:ff:ff:ff:ff:ff
        inet 192.0.2.10/24 scope global lab0
           valid_lft forever preferred_lft forever
        inet 192.0.2.20/24 scope global secondary lab0
           valid_lft forever preferred_lft forever
        inet6 fe80::e805:5eff:fef8:fbe7/64 scope link
           valid_lft forever preferred_lft forever
  2. Flush the globally scoped addresses from the running interface state.
    $ sudo ip address flush dev lab0 scope global

    ip address flush requires at least one selector. A bare ip address flush returns Flush requires arguments. Use ip -stats address flush … when you want a deletion count or an explicit Nothing to flush. message.

    Without scope global, ip address flush dev lab0 can also remove link-local addresses from that interface.

  3. Verify that only the intended addresses were removed.
    $ ip address show dev lab0
    12: lab0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1400 qdisc noqueue state UNKNOWN group default qlen 1000
        link/ether ea:05:5e:f8:fb:e7 brd ff:ff:ff:ff:ff:ff
        inet6 fe80::e805:5eff:fef8:fbe7/64 scope link
           valid_lft forever preferred_lft forever
  4. Re-add only the addresses that should remain, or fix the host's saved network configuration before the next restart or interface bounce.

    ip address flush changes runtime state only, so saved network config can still restore the old addresses later.