ifconfig(1M)ifconfig(1M)NAMEifconfig - configure network interface parameters
SYNOPSIS
mod1[,mod2]...] interface [address_family] [address[dest_address]]
[parameters]
interface [address_family]
DESCRIPTION
The first form of the command assigns an address to a network interface
and/or configures network interface parameters. 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 speci‐
fied, reports the details on all supported address families. An excep‐
tion is when the user has not configured any interface with an IPv6
address, does not display the IPv6 loopback interface.
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
recognizes the following arguments:
A list of modules that can be pushed on a stream associated with an
interface.
The option can be used to configure an interface manu‐
ally with the specified module names. There is no space
between the module names and only a comma is used to
separate the module names. If the option is specified,
pushes all modules on the stream associated with the
interface in the specified order. For example, module
mod2 is pushed on top of module mod1. The modules are
pushed between IP and network drivers. If the option is
not specified, the modules (if any) specified in the
DEFAULT_INTERFACE_MODULES variable are used for config‐
uring the interface (see and in
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 proto‐
cols, 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 (DARPA-Internet
family) for IPv4 addresses, and 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 (See the subsec‐
tion given below.)
parameters One or more of the following operating parameters:
Mark an interface "up".
Enables interface after an Occurs auto‐
matically when setting the address on an
interface. Setting this flag has no
effect if the hardware is "down". A sec‐
ondary interface (see the Interface Nam‐
ing subsection given below) can be marked
up only if the primary interface is
already up.
Mark an interface "down".
When an interface is marked "down", the
system will not attempt to transmit mes‐
sages through that interface. A primary
interface (see the Interface Naming sub‐
section given below) can be marked down
only if all the secondary interfaces on
the same physical device are already
down.
(inet only) Specify the address addr that represents
broadcasts to the network. The default
broadcast address is the address with a
host part of all 1's.
Specify the tunnel encapsulation limit value
n. The tunnel encapsulation limit is the
maximum number of additional encapsula‐
tions permitted for the packets. The
tunnel encapsulation limit option is
defined in RFC 2473. This option is
valid only for tunnel types and The
default is 4.
(inet6 only) Enable forwarding of packets by this inter‐
face.
This is the default behavior.
(inet6 only) Disable forwarding of packets by this
interface.
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.
(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
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-net‐
works, 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 contigu‐
ous 1's in the bit positions starting
from the leftmost bit of the 32-bit
field.
(inet6 only) n indicates the length of the network
prefix associated with this interface.
The primary interface (see Interface Nam‐
ing 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 sec‐
ondary interfaces. Default: 64. Range:
1 to 128.
(inet6 only) Enable processing of received router adver‐
tisements.
Secondary address(es) will be autoconfig‐
ured on the interface using the pre‐
fix(es) received in router advertise‐
ment(s). This is the default behavior.
(inet6 only) Disable processing of received router
advertisements.
(inet6 only) Specify that the address configured is an
anycast
address. Anycast addresses can be
specifed for secondary interfaces only.
Once the anycast address is configured,
the secondary interface needs to be
marked down before configuring a new IPv6
unicast or anycast address on that sec‐
ondary interface.
Specify the type of tunnel. The tunnel types can be
and
Specify the destination
addr of the tunnel. This is the destina‐
tion address in the encapsulating (outer)
header. It should be an unicast address
configured on an interface on the tunnel
exit-point node. For tunnel types and
the addr should be an IPv6 address. For
tunnel type the addr should be an IPv4
address; and for tunnel type the tdst
parameter should not be specified.
Specify the source
addr of the tunnel. This is the source
address in the encapsulating (outer)
header. It should be an unicast address
configured on an interface in the tunnel
entry-point node. For tunnel types and
the addr should be an IPv6 address. For
tunnel types and the addr should be an
IPv4 address.
(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 Res‐
olution Protocol.
(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.
Setup the Streams plumbing needed for TCP/IP for a pri‐
mary interface name.
(See the subsection given below.). By
default, the operation is done automati‐
cally when an IP address is specified for
an interface.
Tear down the Streams plumbing for a primary interface
name.
(See the subsection given below.) Sec‐
ondary interface does not require "plumb‐
ing". 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.
(It is supported only when HP-UX Secure Resource Parti‐
tions is installed
and enabled with system style containers
(refer to srp(5))).
Mark an interface with "force" flag. The
"force" flag initiates the feature of
pushing local communication(communication
within the host) on the wire.
In order to initiate local-local communi‐
cation on wire, "force" flag needs to be
set and user needs to add special route
to reach this interface via gateway from
the other end point of the local-local
communication. (For information, see
"route(1M)" for adding special routes).
local-local communication is never pushed
on the wire in the absence of special
routes.
(It is supported only when HP-UX Secure Resource Parti‐
tions is installed
and enabled with system style containers
(refer to srp(5))).
It is used to disable the feature of
pushing local communication on wire.
This is the default behavior.
Interface Naming
The interface name associated with a network card is composed of the
name of the interface (e.g. or ), 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 will be used to designate Ethernet
encapsulation and for IEEE 802.3 encapsulation. The and commands can
be used to display the interface name and ppa number of each interface
that is associated with a network card (see nwmgr(1M) and 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 sub‐
section given below.)
The tunnel interface names should be for "IP6-in-IP" tunnels and tun‐
nels. Example: The tunnel interface names should be for "IP-in-IP6"
tunnels and "IP6-in-IP6" tunnels. Example:
IP Index Number
Multiple IP addresses assigned to the same interface may be in differ‐
ent subnets. An example of an interface name without an IP index num‐
ber is An example of an interface name with a IP index number is Note:
specifying is equivalent to
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 is automatically configured when the system
boots with the TCP/IP software. The IP address and netmask of the pri‐
mary 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 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. Supernet‐
ting 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 con‐
taining 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 com‐
mand. 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.
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 is automatically assigned a link-local address by
the system when the interface is configured. A link-local address com‐
prises the well-known link-local prefix FE80::/10 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 advertise‐
ments, 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 inter‐
face identifier, the same interface identifier that is used in forming
the primary interface.
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 iden‐
tifier must be 0, per section 2.5.1 of RFC 2373. Accordingly, a manu‐
ally assigned address for a primary interface must have the following
pattern: 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 por‐
tion 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 connec‐
tivity through the overwritten autoconfigured IP address is temporarily
lost. At a later time, when the host receives the next router adver‐
tisement, 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 advertise‐
ment is happening concurrently while the user manually configures sec‐
ondary interfaces.
To disable communication through a specific IP address on an autocon‐
figured 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.
Anycast addresses can only be manually configured and their configura‐
tion will overwrite any manual or auto-configured address on the sec‐
ondary interface.
An IPv6 interface may have four new flags that are not present on an
IPv4 interface: and The flag is set for the tunnel interfaces. The
flag is set for autoconfigured secondary interfaces. The flag is set
for interfaces with IP addresses that can be reached without going
through a router. The flag is set for secondary interfaces configured
with an anycast address.
Stateless address autoconfiguration with link-local address
Manual configuration for a primary interface with link-local address
Manual configuration for a secondary interface with link-local address
Manual configuration for a secondary interface with global address
Manual configuration for a secondary interface with an anycast address
Tunnel interface configuration:
HP-UX supports "IP6-in-IP" configured tunnels as specified in RFC 4213,
"IP-in-IP6" and "IP6-in-IP6" configured tunnels as specified in RFC
2473, and automatic tunnel as specified in RFC 3056.
"IP6-in-IP" configured tunnel allows dual stack IPv6/IPv4 nodes to com‐
municate over an IPv4 infrastructure, by encapsulating the IPv6 packet
inside an IPv4 header. The tunnel configuration must be done on both
the local (tunnel entry-point) system and the remote (tunnel exit-
point) system. "IP6-in-IP" tunnels can be configured as shown below:
The source and destination link-local IPv6 addresses of the tunnel
interface are optional; if they are not specified, they will be auto‐
configured based on the tunnel_local_IPv4_address and tun‐
nel_remote_IPv4_address, respectively.
The tunnel_local_IPv4_address should be an address configured on the
local system, and tunnel_remote_IPv4_address should be an address con‐
figured on the remote system.
Example. On the local system:
Example. On the remote system:
If multiple tunnels are configured with the same tun‐
nel_local_IPv4_address, autoconfiguration of only the first tunnel will
succeed. Other tunnels should be manually configured with link-local
addresses.
Manual link-local addresses can be assigned to the tunnel interface as
shown below:
Secondary addresses to the tunnel interfaces can be assigned as shown
below:
"IP-in-IP6" tunnel configuration allows transmission of IPv4 packets
encapsulated in an IPv6 header. "IP-in-IP6" tunnels can be configured
as shown below:
The tunnel_local_IPv6_address should be an unicast address configured
on the local system, and tunnel_remote_IPv6_address should be an uni‐
cast address configured on the remote system. The tunnel configuration
should be done on both the local and the remote systems.
Example. On the local system:
Example. On the remote system:
"IP6-in-IP6" tunnel configuration allows transmission of IPv6 packets
encapsulated in an IPv6 header. "IP6-in-IP6" tunnels can be configured
as shown below:
The tunnel_local_IPv6_address should be an unicast address configured
on the local system, and tunnel_remote_IPv6_address should be an uni‐
cast address configured on the remote system. The tunnel configuration
should be done on both the local and the remote systems.
Example. On the local system:
Example. On the remote system:
tunnel configuration allows automatic tunneling of IPv6 packets encap‐
sulated in an IPv4 header over an IPv4 infrastructure. tunnel inter‐
face can be configured as shown below:
The tunnel_local_IPv4_address should be a global IPv4 address. The
primary address of the interface should be a address and not a link-
local address. The primary address is optional, if it is not speci‐
fied, a address will be autoconfigured based on tun‐
nel_local_IPv4_address.
Example:
A address can be manually assigned as shown below:
To advertise a prefix, see rtradvd(1M).
EXAMPLES
To configure the primary interface lan0 with a subnet mask and set to
the default broadcast address
To change the default broadcast address
To check configuration values for network interface lan0
To configure secondary interface lan0:1. By default this turns the
interface "up"
or
To bring down secondary interface lan0:1
or
To disable and enable the interface
To remove secondary interface lan0:1
To remove primary interface lan0. Note: All secondaries should have
been brought down first for interface lan0 to be unplumbed.
To assign another IP address to loopback interface lo0. Note: Primary
loopback interface (lo0:0) cannot be changed.
To change the routing metric of interface lan0 to 3. This makes the
routing protocol prefer routes with values of 0, 1 or 2.
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.
WARNINGS
The and commands are deprecated. These commands will be removed in a
future HP-UX release. HP recommends the use of replacement command
nwmgr(1M) to perform all network interface-related tasks.
AUTHOR
was developed by HP and the University of California, Berkeley.
SEE ALSOnetstat(1), lanscan(1M), nwmgr(1M), route(1M), rtradvd(1M), inet(3N),
inet6(3N), hosts(4), NDP(7P), route(7P), routing(7).
IP Version 6 Addressing Architecture, RFC4291, Hinden, Deering.
Basic Transition Mechanisms for IPv6 Hosts and Routers, RFC 4213, Nord‐
mark, Gilligan.
Generic Packet Tunneling in IPv6 Specification, RFC 2473, Conta, Deer‐
ing.
Connection of IPv6 Domains via IPv4 Clouds, RFC 3056, Carpenter, Moore.
ifconfig(1M)