Menu

Wednesday, March 7, 2012

Linux Command - ifconfig


Ifconfig 
This command is used to configure the network interfaces on the Linux system. The configuration files for each Ethernet Interfaces will be in the below location

/etc/sysconfig/network-scripts/

Syntax:  
# ifconfig [interface]

Example: The below command will display the information of the first “Ethernet Interface”.
# ifconfig eth0



"ifconfig" command without any option will list all the active Ethernet connections.
# ifconfig


This command with "-a" option list all the interfaces including interfaces which are down.
# ifconfig –a


Eth0 – First Ethernet Interface
Lo – Lookback Interface
Sit0 – First Simple interface Traslation


How to bring the specific network interface up and down?
Syntax: 
# ifconfig [interface] down/up

Example: 
# ifconfig eth0 down
# ifconfig eth0 up


# ifdown [OPTIONS] interface-card

Example:
# ifdown eth0
# ifdown eth0:1


# ifup [OPTIONS] interface-card

Example:
# ifup eth0
# ifup eth0:1


Type "man ifconfig" for more information about the this command.