ifconfig Command in Linux with Examples

Posted in

ifconfig Command in Linux with Examples
sangeeta.gulia

Sangeeta Gulia
Last updated on December 22, 2024

    ifconfig is a helpful configuration-related command to change the settings and get information related to the interfaces of the system. In this article, we will go through the description and options related to the ifconfig command of Linux.

    What is ifconfig command?

    The 'ifconfig' tool is used for "interface configuration" in Unix and Linux operating systems . It's used to configure and control queries from a command line interface, and it's also useful for debugging and tuning the system. It may also be used to change the IP address , display all network interfaces, and so on. On Linux, the ifconfig command is more common than the ip command.

    It's because it's been around a very long time. ifconfig was created in 1983 as part of the 4.2BSD operating system. That is to say; it is approximately 9 years older than the original release of Linux. The majority of Linux's early adopters had experience with previous Unix-like operating systems. ifconfig was a familiar tool that got the job done. However, it is now deprecated, and everyone has switched to ip .

    The syntax for this command is

    ifconfig [...OPTIONS] [INTERFACE

    1. –help

    This option is used to get assistance for the ifconfig command. The syntax for the command is:

    ifconfig --help

    2. [-]arp

    This option enables or disables the usage of the ARP protocol on a certain interface. The syntax for the command is:

    ifconfig interface [-]arp

    3. -a

    This option is used to display all the interfaces accessible, irrespective of whether they are down. The syntax for the command is:

    ifconfig -a

    4. -s

    A short list, rather than details can be displayed. The syntax for the command is:

    ifconfig -s

    5. [-]promisc

    On an interface, this option is used to activate or disable promiscuous mode. If this option is set, the interface will receive all packets on the network. The syntax for the command is:

    ifconfig interface [-]promisc

    6. -v

    Run the command in verbose mode to get more information about how it was executed. The syntax for the command is:

    ifconfig -v

    7. up

    The driver for the specified interface is activated using this option. The syntax for the command is:

    ifconfig interface up

    8. down

    This option disables the driver for the specified interface. The syntax for the command is:

    ifconfig interface down

    9. add addr/prefixlen

    This option is used to provide an interface to an IPv6 address. The syntax for the command is:

    ifconfig interface add addr/prefixlen

    10. del addr/prefixlen

    An IPv6 address can be removed from an interface using this option. The syntax for the command is:

    ifconfig interface del addr/prefixlen

    11. [-]allmulti

    This option enables or disables all-multicast mode for a certain interface. If this option is chosen, the interface will receive all multicast packets. The syntax for the command is:

    ifconfig interface [-]allmulti

    12. mtu N

    This option is used by the user to set the Maximum Transfer Unit (MTU). The syntax for the command is:

    ifconfig interface [-]allmulti
    

    Conclusion

    We looked through the definition, history, and many examples and options for the Linux ifconfig command in this article. We can see that it has functionality for getting and configuring ARP information, setting MTU, providing an interface, activating a driver for an interface, and so on.

    People are also reading:

    Leave a Comment on this Post

    0 Comments