ifdown command in Linux with Examples

Unlike ifup command the user can use ifdown command to bring network interface down, not allowing the user to transmit and receive data. Technically it places the network interface in a state where it cannot transmit or receive data. It is used to configure network interfaces based on interface definitions in the file /etc/network/interfaces.

Syntax:

ifdown [-nv] [–no-act] [–verbose] [-i FILE|–interfaces=FILE] [–allow CLASS] -a|IFACE…

Options:

  • -a(–all): This option is used to bring all the interface down which are defined in /etc/network/interfaces.

  • –allow=CLASS: This option will only allow interfaces listed in an allow-CLASS line in /etc/network/interfaces to be acted upon.
  • -v(–verbose): Show or verbose commands as they are executed.
  • -V(–version): Prints the Copyright and version information.

Example:

  • Let us execute a ping command to check the working of my interfaces, they are already configured.

  • Now try to down the interface down using the following command. Here, sudo is used for permissions, -a to work on all devices and v for verbose the output.
    sudo ifdown -av

  • Let us check our ping test and browser.



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.