Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > i

ifconfig(1M)

HP-UX 11i Version 1: September 2005
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

ifconfig — configure network interface parameters

SYNOPSIS

ifconfig interface [address_family] [address [dest_address]] [parameters]

ifconfig interface [address_family]

DESCRIPTION

The first form of the ifconfig command assigns an address to a network interface and/or configures network interface parameters. ifconfig must be used at boot time to define the network address of each interface present on a machine. It can also be used at other times to redefine an interface's address or other operating parameters. If the address_family is not specified, the address family defaults to IPv4.

The second form of the command, without address_family, displays the current configuration for interface. If address_family is not specified, ifconfig reports the details on all supported address families.

Only a user with appropriate privileges can modify the configuration of a network interface. All users can run the second form of the command.

Arguments

ifconfig recognizes the following arguments:

address

Either a host name present in the host name database (see hosts(4)), or a DARPA Internet address expressed in Internet standard dot notation (see inet(3N)) for an IPv4 address and in colon notation (see inet6(3N)) for an IPv6 address.

address_family

Name of protocol on which naming scheme is based. An interface can receive transmissions in differing protocols, each of which may require separate naming schemes. The address_family, affects the interpretation of the remaining parameters on the command line. The only address families currently supported are inet (DARPA-Internet family) for IPv4 addresses, and inet6 for IPv6 addresses.

dest_address

Address of destination system. Consists of either a host name present in the host name database (see hosts(4)), or a DARPA Internet address expressed in Internet standard dot notation (see inet(3N)) for an IPv4 address, and in colon notation (see inet6(3N)) for an IPv6 address.

interface

A string of the form nameunit, such as lan0. (See the Interface Naming subsection given below.)

parameters

One or more of the following operating parameters:

up

Mark an interface "up". Enables interface after an ifconfig down. Occurs automatically when setting the address on an interface. Setting this flag has no effect if the hardware is "down". A secondary interface (see the Interface Naming subsection given below) can be marked up only if the primary interface is already up.

down

Mark an interface "down". When an interface is marked "down", the system will not attempt to transmit messages through that interface. A primary interface (see the Interface Naming subsection given below) can be marked down only if all the secondary interfaces on the same physical device are already down.

broadcast

(inet only) Specify the address that represents broadcasts to the network. The default broadcast address is the address with a host part of all 1's.

metric n

Set the routing metric of the interface to n. The default is 0. The routing metric is used by the routing protocol (see gated(1M)). Higher metrics have the effect of making a route less favorable; metrics are counted as additional hops to the destination network or host.

netmask mask

(inet only) Specify how much of the address to reserve for subdividing networks into sub-networks or aggregating networks into supernets. mask can be specified as a single hexadecimal number with a leading 0x, with a dot-notation Internet address, or with a pseudo-network name listed in the network table (see networks(4)). For subdividing networks into sub-networks, mask must include the network part of the local address, and the subnet part which is taken from the host field of the address. mask must contain 1's in the bit positions in the 32-bit address that are to be used for the network and subnet parts, and 0's in the host part. The 1's in the mask must be contiguous starting from the leftmost bit position in the 32-bit field. mask must contain at least the standard network portion, and the subnet field must be contiguous with the network portion. The subnet field must contain at least 1 bit. For aggregating networks into supernets, mask must only include a portion of the network part. mask must contain contiguous 1's in the bit positions starting from the leftmost bit of the 32-bit field.

prefix n

(inet6 only) n indicates the length of the network prefix associated with this interface. The primary interface (see Interface Naming subsection given below) prefix length is always 10, and is not configurable. The prefix option can be used only with the address option, and only for secondary interfaces. Default: 64. Range: 1 to 128.

arp

(inet only) Enable the user of the Address Resolution Protocol in mapping between network level addresses and link level addresses (default). If an interface already had the Address Resolution Protocol disabled, the user must "unplumb" the interface before it can be enabled for Address Resolution Protocol.

-arp

(inet only) Disable the use of the Address Resolution Protocol. If an interface already had the Address Resolution Protocol enabled, the user must "unplumb" the interface before it can be disabled for Address Resolution Protocol.

plumb

Setup the Streams plumbing needed for TCP/IP for a primary interface name. (See the Interface Naming subsection given below.). By default, the plumb operation is done automatically when an IP address is specified for an interface.

unplumb

Tear down the Streams plumbing for a primary interface name. (See the Interface Naming subsection given below.) Secondary interface does not require "plumbing". A secondary IPv4 interface can be removed by assigning an IP address of 0.0.0.0 to it. Remove a secondary IPv6 interface by assigning an IP address of :: to it.

Interface Naming

The interface name associated with a network card is composed of the name of the interface (e.g. lan or snap ), the ppa number which identifies the card instance for this interface, and an optional IP index number which allows the configuration of multiple IP addresses for an interface. For LAN cards, the interface name lan will be used to designate Ethernet encapsulation and snap for IEEE 802.3 encapsulation. The lanscan command can be used to display the interface name and ppa number of each interface that is associated with a network card (see lanscan(1M)).

IPv4 and IPv6 interfaces can coexist over the same physical network interface device using the same naming scheme. IPv6 interfaces are configured using the "inet6" ifconfig subcommand. (See the IPv6 subsection given below.)

IP Index Number

Multiple IP addresses assigned to the same interface may be in different subnets. An example of an interface name without an IP index number is lan0. An example of an interface name with a IP index number is lan0:1. Note: specifying lan0:0 is equivalent to lan0.

A primary interface is an interface whose IP index number is zero. A secondary interface is an interface whose IP index number is non-zero.

Loopback Interface

The loopback interface (lo0) is automatically configured when the system boots with the TCP/IP software. The IP address and netmask of the primary IPv4 loopback interface are 127.0.0.1 and 255.0.0.0, respectively. The IP address and prefix of the primary IPv6 loopback interface are ::1 and 128 respectively. The user is not permitted to change the address of the primary loopback interface (lo0:0). It is permissible to assign other IP addresses to lo0 with non-zero IP index numbers (lo0:1, lo0:2, etc). This allows a system to have a "system IP" address that is available as long as one interface remains usable.

Supernets

(inet only) A supernet is a collection of smaller networks. Supernetting is a technique of using the netmask to aggregate a collection of smaller networks into a supernet. This technique is particularly useful when the limit of 254 hosts per class C network is too restrictive. In those situations a netmask containing only a portion of the network part may be applied to the hosts in these networks to form a supernet. This supernet netmask should be applied to those interfaces that connect to the supernet using the ifconfig command. For example, a host can configure its interface to connect to a class C supernet, 192.6, by configuring an IP address of 192.6.1.1 and a netmask of 255.255.0.0 to its interface.

IPv6 Interfaces

inet6 must be specified when an IPv6 interface is configured. The address for an IPv6 interface can either be a hostname present in the host name database (see hosts(4)), or an address in the IPv6 colon notation.

Stateless Address Auto-configuration:

Unlike IPv4 interfaces, IPv6 interfaces can be configured without an address and/or a prefix. Stateless address autoconfiguration requires no manual configuration of hosts, minimal (if any) configuration of routers, and no additional servers. A primary interface (lanX:0) is automatically assigned a link-local address by the system when the interface is configured. A link-local address comprises the well-known link-local prefix FE80::0 and the interface identifier, which is typically 64 bits long and is based on EUI-64 identifiers. The link-local address allows automatic discovery of other hosts and routers on the same link, using the Neighbor Discovery Protocol (see NDP(7P)). The link-local address can be used as the source address to communicate with other nodes when no routers are present. If a router on the local link advertises prefixes in router advertisements, the host autoconfigures its secondary interfaces and its default gateway. The address of an autoconfigured secondary interface is formed by prepending the prefix received from the router to the interface identifier, the same interface identifier that is used in forming the primary interface.

Manual Address Configuration:

IPv6 interfaces can also be configured with manually assigned addresses and/or prefixes. A primary interface must be configured with a link-local address and the prefix must not be specified. The prefix is always 10. The universal/local bit, the U bit, of the interface identifier must be 0, per section 2.5.1 of RFC 2373. Accordingly, a manually assigned address for a primary interface must have the following pattern: FE80::xMxx:xxxx:xxxx:xxxx where x is any hexadecimal digit, and M must be 0, 1, 4, 5, 8, 9, C, or D.

When a primary interface is configured with a manually assigned address, secondary interfaces will be autoconfigured if the host receives prefixes from router advertisements. The addresses on the secondary interfaces will be derived from the interface identifier portion of manually configured address in the primary interface.

When a secondary interface is configured with a manually assigned address, and if the user chooses an IP index number that has been used for an autoconfigured secondary interface, the manual configuration overwrites the autoconfiguration. When this happens, network connectivity through the overwritten autoconfigured IP address is temporarily lost. At a later time, when the host receives the next router advertisement, the host will bring up another secondary interface with a different IP index number, but with the same IP address, and network connectivity through that IP address is restored. Normally, a user can avoid this by checking used IP index numbers. However, there is always a possibility that address autoconfiguration due to router advertisement is happening concurrently while the user manually configures secondary interfaces.

To disable communication through a specific IP address on an autoconfigured secondary interface, that secondary interface should be marked down, not removed or overwritten with a different IP address. If that interface is removed or overwritten, the host will reconfigure another secondary interface with the same IP address when it receives the next router advertisement. Alternatively, the router can be configured to stop advertising the prefix that corresponds to the offending IP address.

Tunneling interface:

The tunneling interface, tu0, enables both automatic and configured tunneling when it is marked up. Tunneling allows dual stack IPv6/IPv4 nodes to communicate over IPv4 routing infrastructures, by encapsulating the IPv6 packet inside an IPv4 packet. In automatic tunneling, the tunnel endpoint address is determined by the IPv4-compatible destination address of the IPv6 packet being tunneled. In configured tunneling, the tunnel endpoint address is configured by the user (see route(1m)).

IPv6 interface flags displayed:

An IPv6 interface may have three new flags that are not present in an IPv4 interface: TUNNEL, AUTO, and ONLINK. The TUNNEL flag is set for the tunnel interface (tu0). The AUTO flag is set for autoconfigured secondary interfaces. The ONLINK flag is set for interfaces with IP addresses that can be reached without going through a router.

Examples:

  • ifconfig lan0 inet6 up

  • ifconfig lan0 inet6 fe80::1 up

  • ifconfig lan0:1 inet6 fe80::3 up

  • ifconfig lan0:2 inet6 fec0::6 up

  • ifconfig lan0:3 inet6 2222::4 up

    ifconfig tu0 inet6 up

DIAGNOSTICS

Messages indicate if the specified interface does not exist, the requested address is unknown, or the user is not privileged and tried to alter an interface's configuration.

AUTHOR

ifconfig was developed by HP and the University of California, Berkeley.

SEE ALSO

netstat(1), lanscan(1M), route(1M), inet(3N), inet6(3N), hosts(4), routing(7), NDP(7P).

IP VErsion 6 Addressing Architecture, RFC2373, Hinden, Derring.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2005 Hewlett-Packard Development Company, L.P.