4

What actually happens when I "bring down" and "bring up" a network interface with the following set of commands?

$ ifconfig wlan0 down
$ ifconfig wlan0 up

Is the wireless network interface card powered off and then on? Is the wireless network driver stopped and started?

2
  • 1
    Unix? If so, which flavour? Linux? If so, which distribution?
    – Jan
    Oct 3 '15 at 10:21
  • I am using Debian.
    – Stephen305
    Oct 5 '15 at 3:18
3

These commands will usually boil down to a single ioctl() system call that will clear (1st command) or set (2nd command) the IF_UP flag in the network driver.

What happens after that is up to the driver. It may or may not power cycle the network interface card. It probably won't "stop" (unload?) and "start" (load?) itself (but something else in the system might, in reaction to what the driver does e.g. hotplug code).

The driver is likely to remove the route to the interface that it put in when the interface was originally brought up, and some sort of event is likely to be created depending on the kernel (e.g. hotplug or udev etc).

On Debian it's probably better to use ifdown wlan0 and ifup wlan0 instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.