1.\" Copyright (c) 1983, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgment: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 33.\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.27.2.22 2003/01/26 03:33:56 keramida Exp $ 34.\" $DragonFly: src/sbin/ifconfig/ifconfig.8,v 1.3 2004/03/11 12:28:54 hmp Exp $ 35.\" 36.Dd July 2, 2001 37.Dt IFCONFIG 8 38.Os 39.Sh NAME 40.Nm ifconfig 41.Nd configure network interface parameters 42.Sh SYNOPSIS 43.Nm 44.Op Fl L 45.Op Fl m 46.Ar interface 47.Op Cm create 48.Op Ar address_family 49.Oo 50.Ar address 51.Op Ar dest_address 52.Oc 53.Op Ar parameters 54.Nm 55.Ar interface 56.Cm destroy 57.Nm 58.Fl a 59.Op Fl L 60.Op Fl d 61.Op Fl m 62.Op Fl u 63.Op Ar address_family 64.Nm 65.Fl l 66.Op Fl d 67.Op Fl u 68.Op Ar address_family 69.Nm 70.Op Fl L 71.Op Fl d 72.Op Fl m 73.Op Fl u 74.Op Fl C 75.Sh DESCRIPTION 76The 77.Nm 78utility is used to assign an address 79to a network interface and/or configure 80network interface parameters. 81The 82.Nm 83utility must be used at boot time to define the network address 84of each interface present on a machine; it may also be used at 85a later time to redefine an interface's address 86or other operating parameters. 87.Pp 88The following options are available: 89.Bl -tag -width indent 90.It Ar address 91For the 92.Tn DARPA Ns -Internet 93family, 94the address is either a host name present in the host name data 95base, 96.Xr hosts 5 , 97or a 98.Tn DARPA 99Internet address expressed in the Internet standard 100.Dq dot notation . 101.Pp 102It is also possible to use the CIDR notation (also known as the 103slash notation) to include the netmask. 104That is, one can specify an address like 105.Li 192.168.0.1/16 . 106.Pp 107For 108.Dq inet6 109family, it is also possible to specify the prefix length using the slash 110notation, like 111.Li ::1/128 . 112See the 113.Cm prefixlen 114parameter below for more information. 115.\" For the Xerox Network Systems(tm) family, 116.\" addresses are 117.\" .Ar net:a.b.c.d.e.f , 118.\" where 119.\" .Ar net 120.\" is the assigned network number (in decimal), 121.\" and each of the six bytes of the host number, 122.\" .Ar a 123.\" through 124.\" .Ar f , 125.\" are specified in hexadecimal. 126.\" The host number may be omitted on IEEE 802 protocol 127.\" (Ethernet, FDDI, and Token Ring) interfaces, 128.\" which use the hardware physical address, 129.\" and on interfaces other than the first. 130.\" For the 131.\" .Tn ISO 132.\" family, addresses are specified as a long hexadecimal string, 133.\" as in the Xerox family. 134.\" However, two consecutive dots imply a zero 135.\" byte, and the dots are optional, if the user wishes to (carefully) 136.\" count out long strings of digits in network byte order. 137.Pp 138The link-level 139.Pq Dq link 140address 141is specified as a series of colon-separated hex digits. 142This can be used to 143e.g. set a new MAC address on an ethernet interface, though the 144mechanism used is not ethernet-specific. 145If the interface is already 146up when this option is used, it will be briefly brought down and 147then brought back up again in order to ensure that the receive 148filter in the underlying ethernet hardware is properly reprogrammed. 149.It Ar address_family 150Specify the 151address family 152which affects interpretation of the remaining parameters. 153Since an interface can receive transmissions in differing protocols 154with different naming schemes, specifying the address family is recommended. 155The address or protocol families currently 156supported are 157.Dq inet , 158.Dq inet6 , 159.Dq atalk , 160.Dq ipx , 161.\" .Dq iso , 162and 163.Dq link . 164.\" and 165.\" .Dq ns . 166The default is 167.Dq inet . 168.Dq ether 169and 170.Dq lladdr 171are synonyms for 172.Dq link . 173.It Ar dest_address 174Specify the address of the correspondent on the other end 175of a point to point link. 176.It Ar interface 177This 178parameter is a string of the form 179.Dq name unit , 180for example, 181.Dq Li ed0 . 182.El 183.Pp 184The following parameters may be set with 185.Nm : 186.Bl -tag -width indent 187.It Cm add 188Another name for the 189.Cm alias 190parameter. 191Introduced for compatibility 192with 193.Bsx . 194.It Cm alias 195Establish an additional network address for this interface. 196This is sometimes useful when changing network numbers, and 197one wishes to accept packets addressed to the old interface. 198If the address is on the same subnet as the first network address 199for this interface, a non-conflicting netmask must be given. 200Usually 201.Li 0xffffffff 202is most appropriate. 203.It Fl alias 204Remove the network address specified. 205This would be used if you incorrectly specified an alias, or it 206was no longer needed. 207If you have incorrectly set an NS address having the side effect 208of specifying the host portion, removing all NS addresses will 209allow you to respecify the host portion. 210.It Cm anycast 211(Inet6 only.) 212Specify that the address configured is an anycast address. 213Based on the current specification, 214only routers may configure anycast addresses. 215Anycast address will not be used as source address of any of outgoing 216IPv6 packets. 217.It Cm arp 218Enable the use of the Address Resolution Protocol 219.Pq Xr arp 4 220in mapping 221between network level addresses and link level addresses (default). 222This is currently implemented for mapping between 223.Tn DARPA 224Internet 225addresses and 226.Tn IEEE 227802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses). 228.It Fl arp 229Disable the use of the Address Resolution Protocol 230.Pq Xr arp 4 . 231.It Cm broadcast 232(Inet only.) 233Specify the address to use to represent broadcasts to the 234network. 235The default broadcast address is the address with a host part of all 1's. 236.It Cm debug 237Enable driver dependent debugging code; usually, this turns on 238extra console error logging. 239.It Fl debug 240Disable driver dependent debugging code. 241.It Cm promisc 242Put interface into permanently promiscuous mode. 243.It Fl promisc 244Disable permanently promiscuous mode. 245.It Cm delete 246Another name for the 247.Fl alias 248parameter. 249.It Cm down 250Mark an interface 251.Dq down . 252When an interface is marked 253.Dq down , 254the system will not attempt to 255transmit messages through that interface. 256If possible, the interface will be reset to disable reception as well. 257This action does not automatically disable routes using the interface. 258.It Cm eui64 259(Inet6 only.) 260Fill interface index 261(lowermost 64bit of an IPv6 address) 262automatically. 263.\" .It Cm ipdst 264.\" This is used to specify an Internet host who is willing to receive 265.\" ip packets encapsulating NS packets bound for a remote network. 266.\" An apparent point to point link is constructed, and 267.\" the address specified will be taken as the NS address and network 268.\" of the destination. 269.\" IP encapsulation of 270.\" .Tn CLNP 271.\" packets is done differently. 272.It Cm media Ar type 273If the driver supports the media selection system, set the media type 274of the interface to 275.Ar type . 276Some interfaces support the mutually exclusive use of one of several 277different physical media connectors. 278For example, a 10Mb/s Ethernet 279interface might support the use of either 280.Tn AUI 281or twisted pair connectors. 282Setting the media type to 283.Dq 10base5/AUI 284would change the currently active connector to the AUI port. 285Setting it to 286.Dq 10baseT/UTP 287would activate twisted pair. 288Refer to the interfaces' driver 289specific documentation or man page for a complete list of the 290available types. 291.It Cm mediaopt Ar opts 292If the driver supports the media selection system, set the specified 293media options on the interface. 294The 295.Ar opts 296argument 297is a comma delimited list of options to apply to the interface. 298Refer to the interfaces' driver specific man page for a complete 299list of available options. 300.It Fl mediaopt Ar opts 301If the driver supports the media selection system, disable the 302specified media options on the interface. 303.It Cm tunnel Ar src_addr dest_addr 304(IP tunnel devices only.) 305Configure the physical source and destination address for IP tunnel 306interfaces 307.Pq Xr gif 4 . 308The arguments 309.Ar src_addr 310and 311.Ar dest_addr 312are interpreted as the outer source/destination for the encapsulating 313IPv4/IPv6 header. 314.It Cm deletetunnel 315Unconfigure the physical source and destination address for IP tunnel 316interfaces previously configured with 317.Cm tunnel . 318.It Cm create 319Create the specified network pseudo-device. 320If the interface is given without a unit number, try to create a new 321device with an arbitrary unit number. 322If creation of an arbitrary device is successful, the new device name is 323printed to standard output. 324.It Cm destroy 325Destroy the specified network pseudo-device. 326.It Cm plumb 327Another name for the 328.Cm create 329parameter. 330Included for 331.Tn Solaris 332compatibility. 333.It Cm unplumb 334Another name for the 335.Cm destroy 336parameter. 337Included for 338.Tn Solaris 339compatibility. 340.It Cm vlan Ar vlan_tag 341If the interface is a vlan pseudo interface, set the vlan tag value 342to 343.Ar vlan_tag . 344This value is a 16-bit number which is used to create an 802.1Q 345vlan header for packets sent from the vlan interface. 346Note that 347.Cm vlan 348and 349.Cm vlandev 350must both be set at the same time. 351.It Cm vlandev Ar iface 352If the interface is a vlan pseudo device, associate physical interface 353.Ar iface 354with it. 355Packets transmitted through the vlan interface will be 356diverted to the specified physical interface 357.Ar iface 358with 802.1Q vlan encapsulation. 359Packets with 802.1Q encapsulation received 360by the parent interface with the correct vlan tag will be diverted to 361the associated vlan pseudo-interface. 362The vlan interface is assigned a 363copy of the parent interface's flags and the parent's ethernet address. 364The 365.Cm vlandev 366and 367.Cm vlan 368must both be set at the same time. 369If the vlan interface already has 370a physical interface associated with it, this command will fail. 371To 372change the association to another physical interface, the existing 373association must be cleared first. 374.Pp 375Note: if the 376.Cm link0 377flag is set on the vlan interface, the vlan pseudo 378interface's behavior changes: the 379.Cm link0 380tells the vlan interface that the 381parent interface supports insertion and extraction of vlan tags on its 382own (usually in firmware) and that it should pass packets to and from 383the parent unaltered. 384.It Fl vlandev Ar iface 385If the driver is a vlan pseudo device, disassociate the physical interface 386.Ar iface 387from it. 388This breaks the link between the vlan interface and its parent, 389clears its vlan tag, flags and its link address and shuts the interface down. 390.It Cm metric Ar n 391Set the routing metric of the interface to 392.Ar n , 393default 0. 394The routing metric is used by the routing protocol 395.Pq Xr routed 8 . 396Higher metrics have the effect of making a route 397less favorable; metrics are counted as addition hops 398to the destination network or host. 399.It Cm mtu Ar n 400Set the maximum transmission unit of the interface to 401.Ar n , 402default is interface specific. 403The MTU is used to limit the size of packets that are transmitted on an 404interface. 405Not all interfaces support setting the MTU, and some interfaces have 406range restrictions. 407.It Cm netmask Ar mask 408.\" (Inet and ISO.) 409(Inet only.) 410Specify how much of the address to reserve for subdividing 411networks into sub-networks. 412The mask includes the network part of the local address 413and the subnet part, which is taken from the host field of the address. 414The mask can be specified as a single hexadecimal number 415with a leading 416.Ql 0x , 417with a dot-notation Internet address, 418or with a pseudo-network name listed in the network table 419.Xr networks 5 . 420The mask contains 1's for the bit positions in the 32-bit address 421which are to be used for the network and subnet parts, 422and 0's for the host part. 423The mask should contain at least the standard network portion, 424and the subnet field should be contiguous with the network 425portion. 426.Pp 427The netmask can also be specified in CIDR notation after the address. 428See the 429.Ar address 430option above for more information. 431.It Cm prefixlen Ar len 432(Inet6 only.) 433Specify that 434.Ar len 435bits are reserved for subdividing networks into sub-networks. 436The 437.Ar len 438must be integer, and for syntactical reason it must be between 0 to 128. 439It is almost always 64 under the current IPv6 assignment rule. 440If the parameter is omitted, 64 is used. 441.Pp 442The prefix can also be specified using the slash notation after the address. 443See the 444.Ar address 445option above for more information. 446.\" see 447.\" Xr eon 5 . 448.\" .It Cm nsellength Ar n 449.\" .Pf ( Tn ISO 450.\" only) 451.\" This specifies a trailing number of bytes for a received 452.\" .Tn NSAP 453.\" used for local identification, the remaining leading part of which is 454.\" taken to be the 455.\" .Tn NET 456.\" (Network Entity Title). 457.\" The default value is 1, which is conformant to US 458.\" .Tn GOSIP . 459.\" When an ISO address is set in an ifconfig command, 460.\" it is really the 461.\" .Tn NSAP 462.\" which is being specified. 463.\" For example, in 464.\" .Tn US GOSIP , 465.\" 20 hex digits should be 466.\" specified in the 467.\" .Tn ISO NSAP 468.\" to be assigned to the interface. 469.\" There is some evidence that a number different from 1 may be useful 470.\" for 471.\" .Tn AFI 472.\" 37 type addresses. 473.It Cm range Ar netrange 474Under appletalk, set the interface to respond to a 475.Ar netrange 476of the form 477.Ar startnet Ns - Ns Ar endnet . 478Appletalk uses this scheme instead of 479netmasks though 480.Dx 481implements it internally as a set of netmasks. 482.It Cm remove 483Another name for the 484.Fl alias 485parameter. 486Introduced for compatibility 487with 488.Bsx . 489.It Cm phase 490The argument following this specifies the version (phase) of the 491Appletalk network attached to the interface. 492Values of 1 or 2 are permitted. 493.Sm off 494.It Cm link Op Cm 0 No - Cm 2 495.Sm on 496Enable special processing of the link level of the interface. 497These three options are interface specific in actual effect, however, 498they are in general used to select special modes of operation. 499An example 500of this is to enable SLIP compression, or to select the connector type 501for some Ethernet cards. 502Refer to the man page for the specific driver 503for more information. 504.Sm off 505.It Fl link Op Cm 0 No - Cm 2 506.Sm on 507Disable special processing at the link level with the specified interface. 508.It Cm up 509Mark an interface 510.Dq up . 511This may be used to enable an interface after an 512.Dq Nm Cm down . 513It happens automatically when setting the first address on an interface. 514If the interface was reset when previously marked down, 515the hardware will be re-initialized. 516.It Cm ssid Ar ssid 517For IEEE 802.11 wireless interfaces, set the desired Service Set 518Identifier (aka network name). 519The SSID is a string up to 32 characters 520in length and may be specified as either a normal string or in 521hexadecimal when proceeded by 522.Ql 0x . 523Additionally, the SSID may be cleared by setting it to 524.Ql - . 525.It Cm nwid Ar ssid 526Another name for the 527.Cm ssid 528parameter. 529Included for 530.Nx 531compatibility. 532.It Cm stationname Ar name 533For IEEE 802.11 wireless interfaces, set the name of this station. 534It appears that the station name is not really part of the IEEE 802.11 535protocol though all interfaces seem to support it. 536As such it only 537seems to be meaningful to identical or virtually identical equipment. 538Setting the station name is identical in syntax to setting the SSID. 539.It Cm station Ar name 540Another name for the 541.Cm stationname 542parameter. 543Included for 544.Bsx 545compatibility. 546.It Cm channel Ar number 547For IEEE 802.11 wireless interfaces, set the desired channel. 548Channels range from 1 to 14, but the exact selection available 549depends on the region your adaptor was manufactured for. 550Setting 551the channel to 0 will give you the default for your adaptor. 552Many 553adaptors ignore this setting unless you are in ad-hoc mode. 554.It Cm authmode Ar mode 555For IEEE 802.11 wireless interfaces, set the desired authentication mode 556in infrastructure mode. 557Not all adaptors support all modes. 558The set of 559valid modes is 560.Dq none , 561.Dq open , 562and 563.Dq shared . 564Modes are case insensitive. 565.It Cm powersave 566For IEEE 802.11 wireless interfaces, enable powersave mode. 567.It Fl powersave 568For IEEE 802.11 wireless interfaces, disable powersave mode. 569.It Cm powersavesleep Ar sleep 570For IEEE 802.11 wireless interfaces, set the desired max powersave sleep 571time in milliseconds. 572.It Cm wepmode Ar mode 573For IEEE 802.11 wireless interfaces, set the desired WEP mode. 574Not all adaptors support all modes. 575The set of valid modes is 576.Dq off , 577.Dq on , 578and 579.Dq mixed . 580.Dq Mixed 581mode explicitly tells the adaptor to allow association with access 582points which allow both encrypted and unencrypted traffic. 583On these adaptors, 584.Dq on 585means that the access point must only allow encrypted connections. 586On other adaptors, 587.Dq on 588is generally another name for 589.Dq mixed . 590Modes are case insensitive. 591.It Cm weptxkey Ar index 592For IEEE 802.11 wireless interfaces, set the WEP key to be used for 593transmission. 594.It Cm wepkey Ar key Ns | Ns Ar index : Ns Ar key 595For IEEE 802.11 wireless interfaces, set the selected WEP key. 596If an 597.Ar index 598is not given, key 1 is set. 599A WEP key will be either 5 or 13 600characters (40 or 104 bits) depending of the local network and the 601capabilities of the adaptor. 602It may be specified either as a plain 603string or as a string of hexadecimal digits proceeded by 604.Ql 0x . 605For maximum portability, hex keys are recommended; 606the mapping of text keys to WEP encryption is usually driver-specific. 607In particular, the 608.Tn Windows 609drivers do this mapping differently to 610.Dx . 611A key may be cleared by setting it to 612.Ql - . 613If WEP is supported then there are at least four keys. 614Some adaptors support more than four keys. 615If that is the case, then the first four keys 616(1-4) will be the standard temporary keys and any others will be adaptor 617specific keys such as permanent keys stored in NVRAM. 618.It Cm wep 619Another way of saying 620.Cm wepmode on . 621Included for 622.Bsx 623compatibility. 624.It Fl wep 625Another way of saying 626.Cm wepmode off . 627Included for 628.Bsx 629compatibility. 630.It Cm nwkey key 631Another way of saying: 632.Pp 633.Dq Li "wepmode on weptxkey 1 wepkey 1:key wepkey 2:- wepkey 3:- wepkey 4:-" . 634.Pp 635Included for 636.Nx 637compatibility. 638.It Cm nwkey Xo 639.Sm off 640.Ar n : k1 , k2 , k3 , k4 641.Sm on 642.Xc 643Another way of saying 644.Pp 645.Dq Li "wepmode on weptxkey n wepkey 1:k1 wepkey 2:k2 wepkey 3:k3 wepkey 4:k4" . 646.Pp 647Included for 648.Nx 649compatibility. 650.It Fl nwkey 651Another way of saying 652.Cm wepmode off . 653.Pp 654Included for 655.Nx 656compatibility. 657.El 658.Pp 659The 660.Nm 661utility displays the current configuration for a network interface 662when no optional parameters are supplied. 663If a protocol family is specified, 664.Nm 665will report only the details specific to that protocol family. 666.Pp 667If the driver does supports the media selection system, the supported 668media list will be included in the output. 669.Pp 670If the 671.Fl m 672flag is passed before an interface name, 673.Nm 674will display all 675of the supported media for the specified interface. 676If 677.Fl L 678flag is supplied, address lifetime is displayed for IPv6 addresses, 679as time offset string. 680.Pp 681Optionally, the 682.Fl a 683flag may be used instead of an interface name. 684This flag instructs 685.Nm 686to display information about all interfaces in the system. 687The 688.Fl d 689flag limits this to interfaces that are down, and 690.Fl u 691limits this to interfaces that are up. 692When no arguments are given, 693.Fl a 694is implied. 695.Pp 696The 697.Fl l 698flag may be used to list all available interfaces on the system, with 699no other additional information. 700Use of this flag is mutually exclusive 701with all other flags and commands, except for 702.Fl d 703(only list interfaces that are down) 704and 705.Fl u 706(only list interfaces that are up). 707.Pp 708The 709.Fl C 710flag may be used to list all of the interface cloners available on 711the system, with no additional information. 712Use of this flag is mutually exclusive with all other flags and commands. 713.Pp 714Only the super-user may modify the configuration of a network interface. 715.Sh NOTES 716The media selection system is relatively new and only some drivers support 717it (or have need for it). 718.Sh DIAGNOSTICS 719Messages indicating the specified interface does not exist, the 720requested address is unknown, or the user is not privileged and 721tried to alter an interface's configuration. 722.Sh BUGS 723IPv6 link-local addresses are required for several basic communication 724between IPv6 node. 725If they are deleted by 726.Nm 727manually, the kernel might show very strange behavior. 728So, such manual deletions are strongly discouraged. 729.Sh SEE ALSO 730.Xr netstat 1 , 731.Xr netintro 4 , 732.\" .Xr eon 5 , 733.Xr rc 8 , 734.Xr routed 8 735.Sh HISTORY 736The 737.Nm 738utility appeared in 739.Bx 4.2 . 740