Online Book Reader

Home Category

Managing NFS and NIS, 2nd Edition - Mike Eisler [174]

By Root 495 0
loopback device. Examples of physical devices include Ethernet interfaces or packet drivers stacked on top of low-level synchronous line drivers. IP tunnels are point-to-point interfaces that enable an IP packet to be encapsulated within another IP packet, appearing as a physical interface. For example, an IPv6-in-IPv4 tunnel allows IPv6 packets to be encapsulated within IPv4 packets, allowing IPv6 traffic to cross routers that understand only IPv4.

Examining interfaces

To list all available network interfaces, invoke ifconfig with the -a option:[6]

% ifconfig -a

lo0: flags=1000849 mtu 8232 index 1

inet 127.0.0.1 netmask ff000000

hme0: flags=1000843 mtu 1500 index 2

inet 131.40.52.126 netmask ffffff00 broadcast 131.40.52.255

lo0: flags=2000849 mtu 8252 index 1

inet6 ::1/128

hme0: flags=2000841 mtu 1500 index 2

inet6 fe80::a00:20ff:fe81:23f1/10

hme0:1: flags=2080841 mtu 1500 index 2

inet6 fec0::56:a00:20ff:fe81:23f1/64

hme0:2: flags=2080841 mtu 1500 index 2

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 mtu 1500 index 2

inet 131.40.52.126 netmask ffffff00 broadcast 131.40.52.255

% ifconfig lo0

lo0: flags=1000849 mtu 8232 index 1

inet 127.0.0.1 netmask ff000000

% ifconfig hme0 inet6

hme0: flags=2000841 mtu 1500 index 2

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

Return Main Page Previous Page Next Page

®Online Book Reader