infoLinux

ifconfig Command in Linux

Linux ifconfig config

ifconfig stands for interface configuration. Because Linux ifconfig command enables us to initialize interfaceassign 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 addressMAC address and MTU with ifconfig command .

Here : IP means Internet ProtocolMAC means Media Access ControlMTU 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 ethlo 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.

Leave a Reply

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