3

The question is direct, what does the given command do, and what is it used for?

ifconfig <interface-name> 0.0.0.0

I know that 0.0.0.0 means all IP addresses on my local machine.

Also if I mess up an interface with this command, how do I reset it?

daltonfury42
  • 179
  • 2
  • 10

2 Answers2

4

While this command usually assigns an IP to the interface, using 0.0.0.0 clears the primary IP of it. see here or here. Usually done to allow the ability to assign an IP via DHCP.

FelixJN
  • 166
  • 6
0

You have just given the an invalid IP or a non-routable IP. If you use a DHCP just issue,

dhclient <interface-name>

It will give you back your DHCP ip.

With a static Ip this should do it,

ifconfig <interface-name> < e.g. 192.168.1.125>

A ifdown <interface-name> and ifup <interface-name> should do it if you have manually configured the ip.

kongekrabben
  • 103
  • 6