Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What is the Linux command to clear IP address of an interface without bringing it down and/or restarting network services. Seems strange ifconfig is able to change IP address but has no option to clear it, or am I wrong?

EDIT:As simple as ifconfig eth0 They should have put it in the man

share|improve this question
Hi. Why do you want to set the IP address to –  Andy Jun 17 '10 at 9:27
@Andy: I think you misunderstood the question. @jackhab wants to unassign an address from the interface, not set it to -- it's just how it is done with ifconfig. –  grawity Jun 17 '10 at 10:36
@grawity Cheers. Unassigning an address is switching the NIC off to all intents and purposes? –  Andy Jun 17 '10 at 11:03
@Andy: Not necessarily. One could still watch incoming packets. Also, a NIC can have multiple addresses (though it doesn't apply in this case). –  grawity Jun 17 '10 at 21:33
@grawity Thanks again –  Andy Jun 18 '10 at 8:46

4 Answers 4

iproute2 with accurate prefix length:

ip addr del dev eth0

To remove all addresses:

ip addr flush dev eth0
share|improve this answer

As simple as ifconfig eth0 They should have put it in the man

share|improve this answer

Things you should know about IP address

RFC 5735 -- Special Use IPv4 Addresses - Addresses in this block refer to source hosts on "this" network. Address may be used as a source address for this host on this network; other addresses within may be used to refer to specified hosts on this network

What is an IP address? at HowStuffWorks.

Out of the almost 4.3 billion possible combinations, certain values are restricted from use as typical IP addresses. For example, the IP address is reserved for the default network and the address is used for broadcasts.

IP address at About.com

Computers normally show an address of when they are not connected to a TCP/IP network. Having this address, a computer cannot be reached or communicate with any other devices over IP.

And, this can be confusing sometimes -- but, all it means is
when you see packets with source IP, just assume it means 'Null',
and, if you see it being used to match IP addresses, take it as a 'wildcard'.

TCP/IP software applications also use as a programming technique to monitor network traffic from any valid IP address. While connected computers do not use this address, messages carried over IP sometimes include inside the header when the source of the message is unknown.

share|improve this answer
I am not trying to assign to an interface. I removing existing IP address from it. –  jackhab Jun 18 '10 at 16:37

For the folks who google these things such as myself a special note is helpful: Mac OS X does not behave the same as Linux in this regard. I doubt that any of the BSDs do. This is an interesting edge case for the ifconfig authors because apperantly the two most widely used implementations of ifconfig handle this differently.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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