[ Team LiB ] Previous Section Next Section

Displaying Network Interface Parameters (ifconfig)

You can use the ifconfig command to display information about specific interfaces, assign an address to a network interface, or configure network interfaces. The /etc/rc2.d scripts run ifconfig at boot time to define the network address of each interface present on a system. You can also use ifconfig at a later time to redefine an interface address or other operating parameters. Refer to the ifconfig(1M) manual page for complete information. The following sections describe how to use the ifconfig command to display information about specific interfaces.

The ifconfig command has been modified in the Solaris 8 release to create the IPv6 stack and to support new parameters.

Displaying Information About All Interfaces on a System

Use the -a option of the ifconfig command to display information about all interfaces on a system. The following example shows the interfaces on the system paperbark.


paperbark% ifconfig -a
lo0:  flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
         inet 127.0.0.1 netmask ff000000
hme0:  flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
         inet 172.16.8.22 netmask ffffff00 broadcast 172.16.8.255
paperbark%

The flags section shows the status of the interface. The mtu field tells you the maximum transfer size in octets. Information on the second line includes the IP address of the host you are using, the netmask currently being used, and the IP broadcast address of the interface.

The following example shows the interfaces on the system castle.


castle% ifconfig -a
lo0:  flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232
         inet 127.0.0.1 netmask ff000000
le0:  flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
         inet 172.16.8.19 netmask ffff0000 broadcast 172.16.255.255
castle%



Displaying Information About Specific Interfaces

Use the following syntax to display information about the configuration of a specific interface.


ifconfig interface-name [ protocol-family]

The following example displays information about the hme0 interface.


paperbark% su
Password
# ifconfig hme0
hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 172.16.8.22 netmask ffffff00 broadcast 172.16.8.255
        ether 8:0:20:7d:79:d4
#

The flags section shows that the interface is configured UP, is 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, the netmask currently being used, and the IP broadcast address of the interface. The third line gives the system address (in this case, Ethernet) of the host.

    [ Team LiB ] Previous Section Next Section