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