When I need to create a temporary bridge with interface on Linux I would use the following:

brctl addbr br0
brctl addif br0 eth0
ifconfig eth0
ifconfig br0 netmask
ifconfig br0 up

I have been updating my process to use the ip command, However, I do not find the equivalent for removing the IP stack (ifconfig eth0 via the ip command

I have tried the following:

ip addr add dev eth0
ip addr add dev eth0

but it does not work to remove the existing ip on that device.

would anyone happen to know if this is possible with the ip command


On Linux, the old ifconfig command and its old Linux kernel API is limited to one IPv4 address per interface (and so interface aliases, which are really additional addresses rather than interfaces, are used to work around this limitation). This explains why to remove the IPv4 address, the method was to set it to (not really add)

With iproute2 tools, if you want to remove any address from an interface (always a good idea for a bridge port) without caring what address(es) are there, you can use ip address flush, which is a bulk removal command:

ip address flush - flush protocol addresses

This command flushes the protocol addresses selected by some criteria.


Warning: This command and other flush commands are unforgiving. They will cruelly purge all the addresses.


So in the end you can use:

ip address flush dev eth0

(you could add -4 to limit the effect to IPv4).

There are other uses. For example this command:

  ip address flush to

would remove from any interface any address matching the block whatever its netmask.

# ip -s -s address flush to
2: lxcbr0    inet brd scope global lxcbr0
       valid_lft forever preferred_lft forever
158: eth0    inet scope global eth0
       valid_lft forever preferred_lft forever

*** Round 1, deleting 2 addresses ***
*** Flush is complete after 1 round ***
  • Great answer, thank you for giving such a complete response – marshelgot Dec 4 '20 at 13:41

You can't delete an IP address with the add command!

If you want to delete an IP address from an interface, you del it.

ip addr del dev eth0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.