How To Configure Network Interface Using IFCONFIG


One of many useful commands to master as an administrator of Linux systems is the ifconfig command. Ifconfig command is used to configure network interfaces. Ifconfig is used to initialize the network interface and to enable or disable the interfaces.

Common Uses

Here are several common usages of ifconfig command.

View Network Settings of an Ethernet Adapter

Ifconfig, when invoked with no arguments will display all the details of currently active interfaces. If you give the interface name as an argument, the details of that specific interface will be displayed.

Display Details of All interfaces

Assign as the IP address for the interface eth0

Change Subnet mask of the interface eth0

Change Broadcast address of the interface eth0

Assign ip-address, netmask and broadcast at the same time to interface eht0

Take Down an Interface

Bring Up an Interface

Change MTU

This will change the Maximum transmission unit (MTU) to XX. MTU is the maximum number of octets the interface is able to handle in one transaction. For Ethernet the Maximum transmission unit by default is 1500. This usually will get change to correct netork communication issues. In this example we are changing the MTU to 1480.

Some Un-Common Uses

Set NIC to Promiscuous mode

By default when a network card receives a packet, it checks whether the packet belongs to itself. If not, the interface card normally drops the packet. But in promiscuous mode, the card doesn’t drop the packet. Instead, it will accept all the packets which flows through the network card. This is very useful in troubleshooting connection issues.

Remove NIC from Promiscuous mode


As you can see ifconfig is a very handy tool to have knowledge as a Linux administrator and is easy and quick to manage your systems.

2 Responses to “How To Configure Network Interface Using IFCONFIG”

  1. waqar says:

    eth0: flags=4163 mtu 1480
    inet netmask broadcast
    inet6 fe80::8b44:4871:3b3:1fb7 prefixlen 64 scopeid 0x20
    ether 08:00:27:5f:17:79 txqueuelen 1000 (Ethernet)
    RX packets 9077 bytes 5081903 (4.8 MiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 6055 bytes 666365 (650.7 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    lo: flags=73 mtu 65536
    inet netmask
    inet6 ::1 prefixlen 128 scopeid 0x10
    loop txqueuelen 1 (Local Loopback)
    RX packets 96 bytes 8528 (8.3 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 96 bytes 8528 (8.3 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    root@kali:~ sir still have the problem i never set static ip im trying from a year ago please help me sir

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.