ifconfig is a network management tool in Linux that we can use to check the IP addresses of Linux systems as well as configure network interfaces. It allows users to to configure, manage and query network interface parameters via command line interface or in a system configuration scripts. In this guide, we will see how to use this tool to make our network management tasks easier.
View network settings
The ifconfig command without any arguments displays the status of all the network interfaces associated with the Linux system.
#ifconfig
To display the above output in short format, use the -s option.
#ifconfig -s
List all network interfaces
The following command will display information of all active or inactive network interfaces on your system.
#ifconfig -a
View Network settings of an interface
The following command will display details of specific network interface.
#ifconfig <interface>
Enable/Disable Network interfaces
Use the following command to enable an interface:
#ifconfig <interface> up
Use the following command to disable an interface:
#ifconfig <interface>down
Assign an ip address to an interface
Use the following command with an interface name (eth0) and ip address that you want to set:
#ifconfig <interface> <ip_address>
Assign a Netmask to the interface
Using the “ifconfig” command with “netmask” argument and interface name as (eth0) allows you to define an netmask to an given interface.
# ifconfig <interface> netmask <netmask>
Enable/Disable Promiscuous mode
Promiscuous mode refers to an operational mode that allows a network adapter to access and view all packets in a network. In this mode, the adapter does not filter packets.
To enable promiscuous mode use the following command:
#ifconfig <interface> promisc
To disable promiscuous mode, use the following command:
#ifconfig <interface> - promisc
Change MTU value
You can change mtu (Maximum Transmission Unit) value using the following command:
#ifconfig <interface> mtu <value>
Latest posts by Ruwantha Nissanka (see all)
- 4 ways to hide your identity using linux - January 18, 2021
- How To Install Kali Linux in Virtualbox - December 31, 2020
- Kali Linux : The OS That Hackers Use - December 31, 2020
- How to monitor user activity in Linux with Acct - December 30, 2020
- Debsecan : You will not miss another security update - December 28, 2020