System Administration Guide, Volume 3

ifconfig Command

The ifconfig command displays information about the configuration of an interface that you specify. (Refer to the ifconfig(1M) man page for details.) The syntax of ifconfig is:

ifconfig interface-name [protocol_family]

ifconfig Command Task Map

Table 6-7 ifconfig Command Task Map

Task 

Description 

For Instructions, Go To ... 

Get information about a specific interface. 

Involves using the ifconfig command.

"How to Get Information About a Specific Interface"

Get information about all interfaces on a network. 

Involves using the -a option of the ifconfig command.

"nsswitch.conf File -- Specifying Which Name Service to Use"

How to Get Information About a Specific Interface

  1. Become superuser.

  2. On the command line, type the following command.


    # ifconfig interface
    

For an le0 interface, your output resembles the following:


le0: flags=863<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
 	inet 129.144.44.140 netmask ffffff00 broadcast 129.144.44.255
ether 8:0:20:8:el:fd

The flags section just given shows that the interface is configured "up," capable of broadcasting, and not using "trailer" link level encapsulation. The mtu field tells you that this interface has a maximum transfer size of 1500 octets. Information on the second line includes the IP address of the host you are using, the netmask being currently used, and the IP broadcast address of the interface. The third line gives the machine address (Ethernet, in this case) of the host.

How to Get Information About All Interfaces on a Network

A useful ifconfig option is -a, which provides information on all interfaces on your network.

  1. Become superuser.

  2. On the command line, type the following command.


    # ifconfig -a interface
    

This produces, for example:


le0:  flags=49<UP,LOOPBACK,RUNNING> mtu 8232
     inet 127.144.44.140 netmask ff000000 
le0:flags=863<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
     inet 129.144.44.140 netmask ffffff00 broadcast 129.144.44.255
ether 8:0:20:8:el:fd

Output that indicates an interface is not running might mean a problem with that interface. In this case, see the ifconfig(1M) man page.