[PLUG] ifconfig

Russell Senior russell at personaltelco.net
Sat Jan 29 00:53:32 UTC 2011


>>>>> "Sean" == Sean Whitney <sean.whitney at gmail.com> writes:

Sean> I've been working with some virtualization technologies and I
Sean> keep seeing commands like

Sean> ifconfig eth0 0

Sean> I'm wondering what the 0 does?  Google isn't very helpful, nor
Sean> is the man page.

It basically deconfigures any ip address associated with the
interface.  I use it frequently when switching back and forth between
wireless and wired interfaces to the same network (e.g. while
debugging a wireless problem).  If both interfaces are configured on
the same network (which might happen by associating and getting DHCP
from wireless, then plugging an ethernet into a LAN port and getting
DHCP for that), the networking stack gets confused over which
interface to use to reach a local destination, so deconfiguring helps
unconfuse things.  Just downing the interface doesn't necessarily
help, btw.  This series of commands (not tested) should show what is
happening: 

  dhclient eth0
  ifconfig eth0
  ifconfig eth0 down
  ifconfig eth0
  ifconfig eth0 0.0.0.0 (or just 0 for short)
  ifconfig eth0 


-- 
Russell Senior, President
russell at personaltelco.net



More information about the PLUG mailing list