There's nothing simpler in Linux network configuration than setting an IP address with the ifconfig utility. Changing it isn't hard either. But at some point I ran into the question - how the heck do I remove it? I mean, with ifconfig I can reassign the IP address, and ifconfig lets you remove an IPv6 address, but what do you do with IPv4?
So, to remove an IP address from a network card in Linux, all we need to do is run this command:
$ sudo ip addr del AA.BB.CC.DD/NN dev ethX
or
$ sudo ifconfig ethX 0.0.0.0
(thanks to the comment below)
where instead of AA.BB.CC.DD/NN you specify the IP address to be removed, and instead of ethX - the name of the network interface
Comments