Disable IPv4: What exactly does 'ifconfig eth0 0' do?
I'm experimenting with Linux and networks. What I'm trying to do is disable IPv4 for remote connections. It shouldn't be that complicated but I didn't find much about this topic. However, there is one solution which seems to work.
I cannot remember where I got that from but the comand ifconfig eth0 0
seems to remove the IPv4 address from eth0, leaving the interface only with its IPv6 address. That it what I wanted to achive, but now I wonder how I did it. I don't know what this command actually does since I didn't find these parameters in the ifconfig manual.
Can someone point out to me, what this command does? I don't want to use it for the wrong reasons. Also, if there are alternative ideas on how to disable IPv4, I'd like to hear them.
Thanks in advance!
Solution 1:
Yes, the command ifconfig eth0 0
zeros (removes) the IP address assigned to interface eth0
. From the manual of ifconfig
, you can read:
ifconfig [-v] interface [aftype] options | address ...
However, the command I use to remove IP from an interface is:
ip addr del IP_add_ress/mask dev eth0