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.
The second form of the command,
without
address_family,
displays the current configuration for
interface.
If
address_family
is also specified,
ifconfig
reports only the details specific to that address family.
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)).
- 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.
Therefore, it is necessary to specify the
address_family,
which may affect interpretation
of the remaining parameters on the command line.
The only address family currently supported is
inet
(DARPA-Internet family).
- 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)).
- 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".
- down
Mark an interface "down".
When an interface is marked "down",
the system will not attempt to transmit messages through that interface.
- 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 2 bits. The subnet part after
performing a bit-wise AND operation between the
address
and the
mask
must not contain all 0's or all 1's.
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.
- arp
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
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" and it can be removed by assigning an IP
address of 0.0.0.0.
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)).
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.
Loopback Interface
The loopback interface
(lo0)
is automatically configured when the
system boots with the TCP/IP software. The default IP address and
netmask of the loopback interface are 127.0.0.1 and 255.0.0.0, respectively.
The user is not permitted to change the address of the primary loopback
interface
(lo0:0).
Supernets
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.
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.