Thursday, October 4, 2012


Ifconfig or interface configuration is a system administration utility in Unix-like operating systems to configure, control, and query TCP/IP network interface parameters.Ifconfig gives you the various details like Ip address , Mast address e.t.c.This can also be used in disabling and enabling a given configuration.

The following example output samples display the state of a single active interface each on a Linux-based host (interface eth0).

[xprk477@omhq13aa ~]$ /sbin/ifconfig eth0
eth0   Link encap:Ethernet  HWaddr 02:00:30:00:03:AA
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::30ff:fe00:3aa/64 Scope:Link
          RX packets:837810597 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1087417750 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:611883055593 (569.8 GiB)  TX bytes:705522440469 (657.0 GiB)

·Link encap: the type of the hardware physical medium supported by this interface (Ethernet, in this case)
·HWaddr: the unique identifier of the NIC card. Every NIC card has a unique identifier assigned by the manufacturer, called MAC address. The MAC value never changes.
·Mask: the netmask
·inet addr: the IP address attached to the interface
·RX packets: the number of packets received by this interface
·TX packets: the number of packets sent
·errors: the number of errors in sending or receiving

up/down – enables or disables a specific interface. You can use the down to shutdown an interface like,

 ifconfig eth0 down

If we need to bring that up we can use,

 ifconfig eth0 up

add – sets a specific IP address for the interface. To set an IP address of to the interface eth0, we can use

# ifconfig eth0 add

netmask – sets the netmask parameter of the interface. Here is an example where you can set the netmask of the eth0 interface to

# ifconfig eth0 netmask

Few More Examples Include

Assign ip-address to an Interface
Assign as the IP address for the interface eth0.
# ifconfig eth0

Change Subnet mask of the interface eth0.
# ifconfig eth0 netmask

Change Broadcast address of the interface eth0.
# ifconfig eth0 broadcast

Assign ip-address, netmask and broadcast at the same time to interface eht0.
# ifconfig eth0 netmask broadcast

Happy Learning , More To Come