ifconfig(8) — Maintenance
NAME
ifconfig − Configures or displays network interface parameters
SYNOPSIS
/usr/sbin/ifconfig interface_id [address_family] [address [dest_address]] [parameters]
The ifconfig command assigns and displays an address to a network interface, and configures network interface parameters.
DESCRIPTION
You use the ifconfig command at boot time to define the network address of each interface. You can also use the ifconfig command at other times to redefine the address of an interface or to set other operating parameters.
Note
If you want to redefine the interface address or the netmask, use the netsetup command. Otherwise, any daemons currently running will use the old address and netmask, and will fail. The netsetup command will make the necessary changes and restart the network services.
Any user can query the status of a network interface; only the superuser can modify the configuration network interfaces.
You specify an interface with the ifconfig interface_id syntax. (See your hardware documentation for information on obtaining an interface ID.)
If you do not specify an address or optional parameters, the ifconfig program displays the current configuration for the specified network interface only.
If a protocol family is specified by the address_family parameter, ifconfig reports only the configuration details specific to that protocol family.
When changing an interface configuration, an address family, which may alter the interpretation of succeeding parameters, must be specified. This family is required because an interface can receive transmissions in different protocols, each of which may require a separate naming scheme.
For the inet family, the address_family parameter is either a hostname or an Internet address in the standard dotted-decimal notation.
For the Xerox Network Systems family, addresses are net:a.b.c.d.e.f , where net is the assigned network number (in decimal), and each of the 6 bytes of the host number, a to f, are specified in hexadecimal. The host number may be omitted on 10-Mbps (Megabits per second) Ethernet interfaces, which use the hardware physical address, and on interfaces other than the first.
The destination address (dest_address) argument specifies the address of the correspondent on the remote end of a point-to-point link.
Parameters
netmask mask
Specifies how much of the address to reserve for subdividing networks into sub-networks. This parameter can only be used with an address family of inet.
The mask variable includes both the network part of the local address and the subnet part, which is taken from the host field of the address. The mask can be specified as a single hexadecimal number beginning with 0x, in the standard Internet dotted-decimal notation, or beginning with a name.
The mask contains 1s (ones) for the bit positions in the 32-bit address that are reserved for the network and subnet parts, and 0s (zeros) for the bit positions that specify the host. The mask should contain at least the standard network portion.
trailersRequests the use of a trailer link-level encapsulation when sending messages.
If a network interface supports trailers, the system will, when possible, encapsulate outgoing messages in a manner that minimizes the number of memory-memory copy operations performed by the receiver. On networks that support the Address Resolution Protocol (see arp), this flag indicates that the system should request that other systems use trailers when sending to this host. Similarly, trailer encapsulations will be sent to other hosts that have made such requests. Currently used by Internet protocols only.
−trailersDisables the use of a trailer link-level encapsulation. The use of -trailers may be disabled by default (check your vendor documentation).
upMarks an interface as working (up). This parameter is used automatically when setting the first address for an interface, or can be used to enable an interface after an ifconfig down command. If the interface was reset when previously marked with the parameter down (see the following section for a description of this parameter), the hardware will be reinitialized.
downMarks an interface as not working (down), which keeps the system from trying to transmit messages through that interface. If possible, the ifconfig command also resets the interface to disable reception of messages. Routes that use the interface, however, are not automatically disabled.
arpEnables the use of the Address Resolution Protocol (ARP) in mapping between network-level addresses and link-level addresses. This parameter is on by default.
−arpDisables the use of the ARP. Use of this parameter is not recommended, however, as your system will then only be able to communicate with other hosts that are configured with the parameter −arp.
broadcastSpecifies the address to use to represent broadcasts to the network. The default broadcast address is the address with a host part consisting of all 1s (ones). Note that the computation of the host part is dependent on netmask (see the description of the netmask parameter).
ipmtu mtu_value
Alters the size of the maximum transfer unit (MTU) for messages that your system transmits. It might be necessary to reduce the MTU size so that bridges connecting token rings can transfer frames without error.
promiscSets the interface into promiscuous mode. This directs the network interface to receive all packets off the network, rather than just those packets directed to the host.
−promiscDisables the promiscuous mode of the interface. This is the default.
allmultiEnables the reception of all multicast packets.
−allmultiDisables the reception of all multicast packets.
debugEnables driver-dependent debug code. This might turn on extra console error logging. (See your hardware documentation for further information.)
−debugDisables driver-dependent debug code.
dest_addressSpecifies the correspondent on the other end of a point-to-point link.
ipdstSpecifies an Internet host willing to receive IP packets encapsulating packets bound for a remote network. For a Network Systems (NS) case, an apparent point-to-point link is constructed, and the address specified will be taken as the NS address and network of the destination host.
aliasEstablishes an additional network address for this interface. This is sometimes useful when changing network numbers and one wishes to accept packets addressed to the old interface.
deleteRemoves the network address specified. This would be used if you incorrectly specified an alias, or if it was no longer needed. If you have incorrectly set an NS address having the side effect of specifying the host portion, removing all NS addresses will allow you to respecify the host portion.
If no address is specified, all network addresses for the interface are deleted.
metric number
Sets the routing metric, or number of hops, for the interface to the value of number. The default value is 0 (zero) if number is not specified, indicating that both hosts are on the same network. The routing metric is used by the routed daemon, with higher metrics indicating that the route is less favorable.
speedSets the speed at which the token ring adapter transmits and receives on the token ring network. The adapter speed must match the signal speed of the token ring. The speed value can be either 4 for a ring speed of 4Mbs or 16 for 16Mbs.
After the interface is online, you can use the ifconfig up and down options to change the speed value dynamically. Stop adapter transmission with down and set the speed in the same command line. Then specify up without a speed value to restart the adapter.
EXAMPLES
1.To query the status of serial line interface sl0, enter:
$ ifconfig sl0
sl0: flags=10<POINTOPOINT>
2.To configure the local loopback interface, enter:
# ifconfig lo0 inet 127.0.0.1 up
Only a user with superuser authority can modify the configuration of a network interface.
3.To configure the token ring interface for a 4 Mbps token ring, enter:
# ifconfig tra0 130.180.4.1 netmask 255.255.255.0 speed 4
4.To stop the token ring interface and start it for a 16 Mbps token ring, enter:
# ifconfig tra0 down
# ifconfig tra0 speed 16 up
FILES
/usr/sbin/ifconfig
Specifies the command path
RELATED INFORMATION
Commands: netstat(1), pfconfig(8)