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 0.0.0.0. They should have put it in the man

share|improve this question
1  
Hi. Why do you want to set the IP address to 0.0.0.0? –  Andy Jun 17 '10 at 9:27
1  
@Andy: I think you misunderstood the question. @jackhab wants to unassign an address from the interface, not set it to 0.0.0.0 -- 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

2 Answers 2

iproute2 with accurate prefix length:

ip addr del 1.2.3.4/32 dev eth0

To remove all addresses:

ip addr flush dev eth0
share|improve this answer

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

share|improve this answer

Your Answer

 
discard

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.