ifconfig Command in Linux

Linux ifconfig config

ifconfig stands for interface configuration. Because Linux ifconfig command enables us to initialize interface, assign IP address. It also enable or disable an interface in your system.

That is display route and network interface. It is very helpful for setup network on you system. So please use it for good helping.

View IP address, MAC address and MTU with ifconfig command .

Here : IP means Internet Protocol, MAC means Media Access Control, MTU means Maximum Transmission Unit.

A newer version of ifconfig is ip command and ifconfig command works for all the versions.

Sample syntax of ifconfig command:

ifconfig

After run the command then see your terminal, it shows the IP address of all three that is eth, lo and wlan.

Now Get details of specific interface

You can find IP address of all three differently, use command

# ifconfig eth0  
# ifconfig lo  
# ifconfig wlan0  

Assigning IP address and Gateway

The IP address and the Gateway in your system to an interface but these settings will be disabled after system reboot.

Sample syntax of assign IP address :

# ifconfig eth0 <address> netmask <address>  

Enable or Disable specific interface

You can enable specific interface like here,

# ifup eth0  

You can disable specific interface like here,

# ifdown eth0  

Setting MTU size

Unix or Linux MTU (Maximum Transmission Unit) size is 1500. But you can change size as per your wish.

# Ifconfig eth0 mtu xxxx  

Above example you can replace xxxx with your size.

This Post Has One Comment

Leave a Reply