Linux version here or see replacment ip command.
Max OS X Darwin version
This is one of those commands that varies wildely


Made true HTML and terse by Dennis German

Assigns an address to a network interface and configures parameters.
At boot time defines the network address of each interface present on a machine.
Redefines an interface's address or other operating parameters.

Only the super-user may modify the configuration.

-l list interfaces on the system.

   lo0 gif0 stf0 en0 en1 fw0
-a display information about all interfaces.
-d limits this to interfaces that are down
    gif0: flags=8010 mtu 1280
    stf0: flags=0<> mtu 1280
-u ...up
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    inet netmask 0xff000000 
    inet6 ::1 prefixlen 128 
    ether 00:11:24:47:3f:aa 
    media: autoselect (none) status: inactive
    supported media: none autoselect 10baseT/UTP 
                    <half-duplex> 10baseT/UTP 
                    <half-duplex> 100baseTX 
                    <full-duplex> 10baseT/UTP 
                    <full-duplex> 100baseTX 
                    <full-duplex,flow-control> 10baseT/UTP 
                    <full-duplex,flow-control> 100baseTX 
                    <full-duplex,hw-loopback> 100baseTX 
    inet6 fe80::219:e3ff:fe32:f8c%en1 prefixlen 64 scopeid 0x5 
    inet netmask 0xffffff00 broadcast
    ether 00:19:e3:32:0f:8c 
    media: autoselect status: active
    supported media: autoselect
    lladdr 00:11:24:ff:fe:47:3f:aa 
    media: autoselect <full-duplex> status: inactive
    supported media: autoselect <full-duplex>
-b... broadcast interfaces .
-s supress interfaces which appear not to be connected to a network.
-v Verbose statistics on packets sent and received
-h with -v, "human-readable" format.
-z zeros i/o statistics .

-C list all of the interface cloners , with no additional information.

interface name example: en0
address hostname or IP*
address_family inet, inet6, atalk, iso, and ns address_family which affects interpretation of the remaining parameters.
Since an interface may receive transmissions in differing protocols with different naming schemes, specifying the address family is recommended.
alias Establish an additional network address for this interface, useful when changing network numbers, and one wishes to accept packets addressed to the old interface.
arp Enable the use of the Address Resolution Protocol in mapping between network level addresses and link level addresses (default).
Internet addresses and Ethernet addresses.
( :: 00:01:AC:04:D0:0E )
broadcast mask (Inet only) Specify the address to use to represent broadcasts to the network. The default broadcast address is the address with a host part of all 1's, ie 0x000000FF aka 00.00.00..FF aka 0,0,0,255.
debug Enable driver dependent debugging code; usually, turns on extra console error logging.
delete Remove the network address specified.
used if you incorrectly specified an alias, or 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.
Not for IPv6 addresses, use -alias with explicit IPv6 address instead.
dest_address d Specify the address of the correspondent on the other end of a point-to-point link.
down Mark interface down. The system will not attempt to transmit messages through the interface, resets it and disables reception.
Does not automatically disable routes using the interface.
up Mark an interface up enable an interface after an ifconfig down.
Happens when setting the first address on an interface.
If the interface was reset when previously marked down, the hardware will be re-initialized.
ipdst specify an Internet host to receive ip packets encapsulating NS packets bound for a remote network. An apparent point to point link is constructed, and the address specified will be taken as the NS address and network of the destination.
IP encapsulation of CLNP packets is done differently.
media type Some interfaces support the mutually exclusive use of one of several different physical media connectors.
For example, a 10Mb/s Ethernet interface might support the use of either AUI or twisted pair connectors.
Setting the media type to 10base5 or AUI would change the currently active connector to the AUI port.
Setting it to 10baseT or UTP would activate twisted pair.
Refer to the interfaces' driver man page
mediaopt opts opts is a comma delimited list of options to apply to the interface.
Refer to the interfaces' driver man page
-mediaopt opts Disable ...
mode mode If the driver supports the media selection system, set the operating mode .
For IEEE 802.11 wireless interfaces that support multiple operating modes this directive is used to select between 802.11a, 802.11b, and 802.11g operating modes.
instance minst Set the media instance to minst for devices which have multiple physical layer interfaces (PHYs). Setting the instance on such devices may not be strictly required by the network interface driver as the driver may take care of this automatically;
see the driver's manual page.
metric n Set the routing metric to n, default 0. The routing metric is used by the routing protocol (routed(8)).
Higher metrics have the effect of making a route less favorable;
metrics are counted as addition hops to the destination network or host.
mtu n Set the Maximum Transmission Unit size of the interface to n. Most interfaces don't support this option.
netmask mask (inet, inet6, and ISO) Specify how much of the address to reserve for subdividing networks into sub-networks.
The mask includes the network part of the local address and the subnet part, which is taken from the host field of the address.
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 networks(5).
For INET and INET6 addresses, slash-notation after the address (e.g the high order 24 bits ( 3 octates) define the subnet).

The mask contains 1's for the bit positions in the 32-bit address which are to be used for the network and subnet parts, and 0's for the host part.
For example 0xFFFFFF00 i.e. FF.FF.FF.00 or
First 3 octates specify network subnet, last octate specifies the host.
If my host ( wants to contact your host ( which has different network subnet, my host needs to contact my gateway.
The mask should contain at least the standard network portion, and the subnet field should be contiguous with the network portion.

prefixlen n netmask. specify by prefix length by digits.(inet and inet6 only)
nsellength n (ISO only) This specifies a trailing number of bytes for a received NSAP used for local identification, the remaining leading part of which is taken to be the NET (Network Entity Title). The default value is 1, which is conformant to US GOSIP. When an ISO address is set in an ifconfig command, it is really the NSAP which is being specified. For example, in US GOSIP, 20 hex digits should be specified in the ISO NSAP to be assigned to the interface. There is some evidence that a number differ- ent from 1 may be useful for AFI 37 type addresses.
IEEE 802.11 wireless network interfaces options
nwid id
Configure the Service Set IDentifier (a.k.a. the network name) . The id can either be any text string up to 32 characters in length, or a series of up to 64 hexadecimal digits preceded by 0x.
Setting id to the empty string allows the interface to connect to any available access point.
nwkey key Enable WEP encryption with the key. The key can either be a string, a series of hexadecimal digits preceded by 0x, or a set of keys in the form n:k1,k2,k3,k4, where n specifies which of keys will be used for all transmitted packets, and four keys, k1 through k4, are configured as WEP keys. Note that the order must be match within same network if multiple keys are used. the length of each key is restricted to 40 bits, i.e. 5-character string or 10 hexadecimal digits, while the WaveLAN/IEEE Gold cards accept the 104 bits (13 characters) key.
nwkey persist Enable WEP encryption with the persistent key written in the network card.
nwkey persist:key Write the key to the persistent memory of the network card, and enable WEP encryption
powersave Enable power saving mode.
powersavesleep duration Set the receiver sleep duration in milliseconds
bssid bssid Set the desired BSSID
chan chan
tunnel src_addr dest_addr (IP tunnel devices only) Configure the physical source and destination address for IP tunnel interfaces, including gif(4). The arguments src_addr and dest_addr are interpreted as the outer source/destination for the encapsulating IPv4/IPv6 header.
deletetunnel Unconfigure the physical source and destination address for IP tunnel interfaces
network pseudo-device.
vltime n (inet6 only) Set valid lifetime for the address.
pltime n Set preferred lifetime for the address.(inet6 only)
anycast Set the IPv6 anycast address bit6.
deprecated Set the IPv6 deprecated address bit. (inet6 only)
tentative Set the IPv6 tentative address bit.(inet6 only)
eui64 Fill interface index (lowermost 64bit of an IPv6 address) automatically.
 link[0-2] Enable special processing of the link level, select special modes of operation. An example of this is to enable SLIP compression, or to select the connector type for some ethernet cards.
Refer to the man page for the specific driver for more information.
-link[0-2] Disable...
vlan tag If the interface is a vlan(4) pseudo-interface, set the VLAN tag to tag. a 16-bit number which is used to create an 802.1Q VLAN header for packets sent from the vlan(4) interface. Note that vlan and vlanif must be set at the same time.
vlanif iface If the interface is a vlan(4) pseudo-interface, associate the physical interface iface with it. Packets transmitted through the vlan(4) interface will be diverted to the specified physical interface iface with 802.1Q VLAN encapsulation. Packets with 802.1Q encapsulation received by the physical interface with the correct VLAN tag will be diverted to the associated vlan(4) pseudointerface. The VLAN interface is assigned a copy of the physical interface's flags and Ethernet address. If the vlan(4) interface already has a physical interface associated with it, this command will fail. To change the association to another physical interface, the existing association must be cleared first. Note that vlanif and vlan must be set at the same time.
 agrport iface Add iface to the agr(4) interface.
-agrport iface Remove
Hardware Assisted Checksums (use - to disable)
inbound outbound both
IPv4 header ip4csum-tx ip4csum-rx ip4csum
TCP/IPv4 tcp4csum-tx tcp4csum-rx tcp4csum
UDP /IPv4 udp4csum-tx udp4csum-rx udp4csum
TCP/IPv6 tcp6csum-tx tcp6csum-rx tcp6csum
UDP/IPv6 udp6csum-tx udp6csum-rx udp6csum
tso4 hardware-assisted TCP/IPv4 segmentation on interfaces that support it.

ifconfig displays the current configuration for a network interface when no optional parameters are supplied. If a protocol family is specified, ifconfig will report only the details specific to that protocol family.

-s status If Interface does not appear to be conected to a network, returns 1 (false).
( Not all interface drivers support media status reporting).

-m display all of the supported media for the specified interface.

-L address lifetime is displayed for IPv6 addresses, as time offset string.


netstat(1), agr(4), ifmedia(4), netintro(4), vlan(4), ifconfig.if(5), rc(8), routed(8)