Managing NFS and NIS, 2nd Edition - Mike Eisler [174]
Examining interfaces
To list all available network interfaces, invoke ifconfig with the -a option:[6]
% ifconfig -a
lo0: flags=1000849 inet 127.0.0.1 netmask ff000000 hme0: flags=1000843 inet 131.40.52.126 netmask ffffff00 broadcast 131.40.52.255 lo0: flags=2000849 inet6 ::1/128 hme0: flags=2000841 inet6 fe80::a00:20ff:fe81:23f1/10 hme0:1: flags=2080841 inet6 fec0::56:a00:20ff:fe81:23f1/64 hme0:2: flags=2080841 inet6 2100::56:a00:20ff:fe81:23f1/64 In this example, ifconfig lists four different interfaces, lo0, hme0, hme0:1, and hme0:2. lo0 is the loopback pseudo-device used by IP to communicate between network applications that specify the local host on both end-points. hme0 is the actual physical Ethernet device configured on the host. Note that lo0 is listed in two different lines: the first line reports the loopback configuration in use by IPv4, and the third line reports the loopback configuration in use by IPv6. IPv4 specifies 127.0.0.1 as the loopback address; IPv6 specifies ::1/128. Similarly, the second line reports the IPv4 address used by the hme0 device (131.40.52.126), and the fourth line reports the device's IPv6 link-local address (fe80::a00:20ff:fe81:23f1/10). Solaris supports multiple logical interfaces associated with a single physical network interface. This allows a host to be assigned multiple IP addresses (even if the host only has a single network interface). This is particularly useful when a host communicates over various IPv6 addresses. In this example, hme0:1 and hme0:2 are logical interfaces associated with the physical network interface hme0. hme0:1 uses the site-local IPv6 address fec0::56:a00:20ff:fe81:23f1/64, and hme0:2 uses the global IPv6 address 2100::56:a00:20ff:fe81:23f1/64. To examine a particular network interface, invoke ifconfig with its name as an argument. By default, the IPv4 interface configuration is reported, unless you specify the address family you are interested in, as in the third example: % ifconfig hme0 hme0: flags=1000843 inet 131.40.52.126 netmask ffffff00 broadcast 131.40.52.255 % ifconfig lo0 lo0: flags=1000849 inet 127.0.0.1 netmask ff000000 % ifconfig hme0 inet6 hme0: flags=2000841 inet6 fe80::a00:20ff:fe81:23f1/10 If the specified interface does not exist on the system or is not configured into the kernel, ifconfig reports the error "No such device." The flags field is a bitmap that describes the state of the interface. Values for the flags may be found in /usr/include/net/if.h. The most common settings are: UP The network interface has been marked up and is enabled to send or receive packets. RUNNING Kernel resources, such as device driver buffers, have been allocated to the interface to allow it to handle packets. An interface can be marked UP but not be running if the kernel is having trouble getting resources assigned to the interface. This is usually never a problem for Ethernet interfaces, but may surface when synchronous serial lines or fiber optic links are used. Note that Solaris hosts always have this flag set, regardless of the state of the interface. BROADCAST A valid broadcast address has been assigned to this