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
ifconfig interface address_family [address [dest_address]] [parameters]
ifconfig [-hLmvz] interface [protocol_family]
ifconfig -a [- bdhLmsuvz] [protocol_family]
ifconfig -l [-bdsu]
ifconfig -s interface
Only the super-user may modify the configuration.
-l list interfaces on the system.
lo0 gif0 stf0 en0 en1 fw0
-adisplay information about all interfaces.
-dlimits this to interfaces that are down
mtu 1280 stf0: flags=0<> mtu 1280
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 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 <full-duplex,hw-loopback> en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet6 fe80::219:e3ff:fe32:f8c%en1 prefixlen 64 scopeid 0x5 inet 192.168.1.7 netmask 0xffffff00 broadcast 192.168.1.255 ether 00:19:e3:32:0f:8c media: autoselect status: active supported media: autoselect fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 2030 lladdr 00:11:24:ff:fe:47:3f:aa media: autoselect <full-duplex> status: inactive supported media: autoselect <full-duplex>
-b... broadcast interfaces .
-ssupress interfaces which appear not to be connected to a network.
-vVerbose statistics on packets sent and received
-zzeros i/o statistics .
-C list all of the interface cloners , with no additional information.
|address||hostname or IP*|
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.
( 192.168.1.8 :: 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 |
Does not automatically disable routes using the interface.
| up|| Mark an interface |
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
Setting it to
Refer to the interfaces' driver man page
| mediaopt opts |
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.
| instance minst || Set the media instance to |
see the driver's manual page.
| metric n || Set the routing metric to |
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 || 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 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.
| 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.
(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
|| create |
| 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 || 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
| 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)