1.\" $OpenBSD: ifconfig.8,v 1.353 2020/07/26 18:34:10 kn Exp $ 2.\" $NetBSD: ifconfig.8,v 1.11 1996/01/04 21:27:29 pk Exp $ 3.\" $FreeBSD: ifconfig.8,v 1.16 1998/02/01 07:03:29 steve Exp $ 4.\" 5.\" Copyright (c) 1983, 1991, 1993 6.\" The Regents of the University of California. All rights reserved. 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 3. 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.\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94 33.\" 34.Dd $Mdocdate: July 26 2020 $ 35.Dt IFCONFIG 8 36.Os 37.Sh NAME 38.Nm ifconfig 39.Nd configure network interface parameters 40.Sh SYNOPSIS 41.Nm ifconfig 42.Op Fl AaC 43.Op Ar interface 44.Op Ar address_family 45.Oo 46.Ar address 47.Op Ar dest_address 48.Oc 49.Op Ar parameters 50.Sh DESCRIPTION 51The 52.Nm 53utility is used to assign an address 54to a network interface and/or configure 55network interface parameters. 56Generally speaking, 57.Xr hostname.if 5 58files are used at boot-time to define the network address 59of each interface present on a machine; 60.Nm 61is used at 62a later time to redefine an interface's address 63or other operating parameters. 64.Pp 65.Nm 66displays the current configuration for a network interface 67when no optional parameters are supplied. 68If a protocol family is specified, 69.Nm 70will report only the details specific to that protocol family. 71If no parameters are provided, a summary of all interfaces is provided. 72.Pp 73Only the superuser may modify the configuration of a network interface. 74.Pp 75The following options are available: 76.Bl -tag -width Ds 77.It Fl A 78Causes full interface alias information for each interface to 79be displayed. 80.It Fl a 81Causes 82.Nm 83to print information on all interfaces. 84The protocol family may be specified as well. 85This is the default, if no parameters are given to 86.Nm . 87.It Fl C 88Print the names of all network pseudo-devices that 89can be created dynamically at runtime using 90.Nm Cm create . 91.It Ar interface 92The 93.Ar interface 94parameter is a string of the form 95.Dq name unit , 96for example, 97.Dq en0 . 98If no optional parameters are supplied, this string can instead be just 99.Dq name . 100If an interface group of that name exists, all interfaces in the group 101will be shown. 102Otherwise all interfaces of the same type will be displayed 103(for example, 104.Dq fxp 105will display all 106.Xr fxp 4 107interfaces). 108.It Ar address_family 109Specifies the address family 110which affects interpretation of the remaining parameters. 111Since an interface can receive transmissions in differing protocols 112with different naming schemes, specifying the address family is recommended. 113The address or protocol families currently 114supported are 115.Dq inet 116and 117.Dq inet6 . 118.It Ar address 119Internet version 4 and 6 addresses 120take the form of 121a host name present in the host name database, 122.Xr hosts 5 ; 123.Dq dot 124notation (IPv4); 125colon-separated (IPv6); 126or CIDR notation. 127.It Ar dest_address 128Specify the address of the correspondent on the other end 129of a point-to-point link. 130.El 131.Pp 132The following 133.Ar parameters 134may be set with 135.Nm : 136.Bl -tag -width dest_addressxx 137.It Cm alias 138Establish an additional network address for this interface. 139This is sometimes useful when changing network numbers, and 140one wishes to accept packets addressed to the old interface. 141.It Cm -alias 142A synonym for 143.Cm delete . 144Use of this option is discouraged in favour of 145.Cm delete . 146.It Cm arp 147Enable the use of the Address Resolution Protocol (ARP) 148in mapping 149between network level addresses and link level addresses (default). 150.It Cm -arp 151Disable the use of ARP. 152.It Cm autoconf 153Set the 154.Sy AUTOCONF4 155or 156.Sy AUTOCONF6 157flag on the interface, depending on 158.Ar address_family . 159.Xr slaacd 8 160automatically configures IPv6 addresses for interfaces with 161.Sy AUTOCONF6 162set. 163.Pp 164.Xr dhclient 8 165only configures interfaces with 166.Sy AUTOCONF4 167set. 168.It Cm -autoconf 169Unset the 170.Sy AUTOCONF4 171or 172.Sy AUTOCONF6 173flag on the interface, depending on 174.Ar address_family . 175.It Cm broadcast Ar addr 176(inet only) 177Specify the address to use to represent broadcasts to the 178network. 179The default broadcast address is the address with a host part of all 1's. 180.It Cm create 181Create the specified network pseudo-device. 182At least the following devices can be created on demand: 183.Pp 184.Xr aggr 4 , 185.Xr bridge 4 , 186.Xr carp 4 , 187.Xr egre 4 , 188.Xr enc 4 , 189.Xr eoip 4 , 190.Xr etherip 4 , 191.Xr gif 4 , 192.Xr gre 4 , 193.Xr lo 4 , 194.Xr mgre 4 , 195.Xr mpe 4 , 196.Xr mpw 4 , 197.Xr nvgre 4 , 198.Xr pair 4 , 199.Xr pflog 4 , 200.Xr pflow 4 , 201.Xr pfsync 4 , 202.Xr ppp 4 , 203.Xr pppoe 4 , 204.Xr svlan 4 , 205.Xr switch 4 , 206.Xr tap 4 , 207.Xr trunk 4 , 208.Xr tun 4 , 209.Xr vether 4 , 210.Xr vlan 4 , 211.Xr vxlan 4 , 212.Xr wg 4 213.It Cm debug 214Enable driver-dependent debugging code; usually, this turns on 215extra console error logging. 216.It Cm -debug 217Disable driver-dependent debugging code. 218.It Cm delete 219Remove the default inet address associated with the interface, 220including any netmask or destination address configured with it. 221An address and address family can be given to make the deletion more specific. 222.It Cm description Ar value 223Specify a description of the interface. 224This can be used to label interfaces in situations where they may 225otherwise be difficult to distinguish. 226.It Cm -description 227Clear the interface description. 228.It Cm destroy 229Destroy the specified network pseudo-device. 230.It Cm down 231Mark an interface 232.Dq down . 233When an interface is marked 234.Dq down , 235the system will not attempt to 236transmit messages through that interface. 237If possible, the interface will be reset to disable reception as well. 238This action automatically disables routes using the interface. 239.It Cm group Ar group-name 240Assign the interface to a 241.Dq group . 242.Ar group-name 243may not be longer than 15 characters and must not end with a digit. 244Any interface can be in multiple groups. 245.Pp 246For instance, a group could be used to create a hardware independent 247.Xr pf 4 248ruleset (i.e. not one based on the names of NICs) using 249existing (egress, carp, etc.) or user-defined groups. 250.Pp 251Some interfaces belong to specific groups by default: 252.Pp 253.Bl -dash -width Ds -compact 254.It 255All interfaces are members of the 256.Em all 257interface group. 258.It 259Cloned interfaces are members of their interface family group. 260For example, a PPP interface such as 261.Em ppp0 262is a member of the 263.Em ppp 264interface family group. 265.It 266.Xr pppx 4 267interfaces are members of the 268.Em pppx 269interface group. 270.It 271The interface(s) the default route(s) point to are members of the 272.Em egress 273interface group. 274.It 275IEEE 802.11 wireless interfaces are members of the 276.Em wlan 277interface group. 278.It 279Any interfaces used for network booting are members of the 280.Em netboot 281interface group. 282.El 283.It Cm -group Ar group-name 284Remove the interface from the given 285.Dq group . 286.It Cm hwfeatures 287Display the interface hardware features: 288.Pp 289.Bl -tag -width 14n -offset indent -compact 290.It Sy CSUM_IPv4 291The device supports IPv4 checksum offload. 292.It Sy CSUM_TCPv4 293As above, for TCP in IPv4 datagrams. 294.It Sy CSUM_UDPv4 295As above, for UDP. 296.It Sy VLAN_MTU 297The device can handle full sized frames, plus the size 298of the 299.Xr vlan 4 300tag. 301.It Sy VLAN_HWTAGGING 302On transmit, the device can add the 303.Xr vlan 4 304tag. 305.It Sy CSUM_TCPv6 306As CSUM_TCPv4, but supports IPv6 datagrams. 307.It Sy CSUM_UDPv6 308As above, for UDP. 309.It Sy WOL 310The device supports Wake on LAN (WoL). 311.It Sy hardmtu 312The maximum MTU supported. 313.El 314.It Cm -inet 315Remove all configured 316.Xr inet 4 317addresses on the given interface. 318.It Cm -inet6 319Disable 320.Xr inet6 4 321on the given interface and remove all configured 322.Xr inet6 4 323addresses, including the link-local ones. 324This is the default. 325To turn inet6 on, use 326.Cm eui64 327or 328.Cm autoconf , 329or assign any inet6 address. 330.It Cm instance Ar minst 331Set the media instance to 332.Ar minst . 333This is useful for devices which have multiple physical layer interfaces 334(PHYs). 335Setting the instance on such devices may not be strictly required 336by the network interface driver as the driver may take care of this 337automatically; see the driver's manual page for more information. 338.It Cm link[0-2] 339Enable special processing of the link level of the interface. 340These three options are interface specific in actual effect; however, 341they are in general used to select special modes of operation. 342An example 343of this is to select the connector type for some Ethernet cards. 344Refer to the man page for the specific driver for more information. 345.It Cm -link[0-2] 346Disable special processing at the link level with the specified interface. 347.It Cm lladdr Ar etheraddr Ns | Ns Cm random 348Change the link layer address (MAC address) of the interface. 349This should be specified as six colon-separated hex values, or can 350be chosen randomly. 351.It Cm llprio Ar prio 352Set the priority for link layer communications 353.Pf ( Xr arp 4 , 354.Xr bpf 4 , 355.Xr pppoe 4 ) . 356.It Cm media Op Ar type 357Set the media type of the interface to 358.Ar type . 359If no argument is given, 360display a list of all available media. 361.Pp 362Some interfaces support the mutually exclusive use of one of several 363different physical media connectors. 364For example, a 10Mb/s Ethernet interface might support the use of either 365AUI or twisted pair connectors. 366Setting the media type to 367.Dq 10base5 368or 369.Dq AUI 370would change the currently active connector to the AUI port. 371Setting it to 372.Dq 10baseT 373or 374.Dq UTP 375would activate twisted pair. 376Refer to the interface's driver-specific man page for a complete 377list of the available types, 378or use the following command 379for a listing of choices: 380.Pp 381.Dl $ ifconfig interface media 382.It Cm mediaopt Ar opts 383Set the specified media options on the interface. 384.Ar opts 385is a comma delimited list of options to apply to the interface. 386Refer to the interface's driver-specific man page for a complete 387list of available options, 388or use the following command 389for a listing of choices: 390.Pp 391.Dl $ ifconfig interface media 392.It Cm -mediaopt Ar opts 393Disable the specified media options on the interface. 394.It Cm metric Ar nhops 395Set the routing metric of the interface to 396.Ar nhops , 397default 0. 398The routing metric can be used by routing protocols. 399Higher metrics have the effect of making a route less favorable. 400.It Cm mode Ar mode 401If the driver for the interface supports the media selection system, 402force the mode of the interface to the given 403.Ar mode . 404For IEEE 802.11 wireless interfaces that support multiple modes, 405this directive is used to select between 802.11a 406.Pq Dq 11a , 407802.11b 408.Pq Dq 11b , 409802.11g 410.Pq Dq 11g , 411and 802.11n 412.Pq Dq 11n 413modes. 414.It Cm -mode 415Select the mode automatically. 416This is the default for IEEE 802.11 wireless interfaces. 417.It Cm mpls 418Enable Multiprotocol Label Switching (MPLS) on the interface, 419allowing it to send and receive MPLS traffic. 420.It Cm -mpls 421Disable MPLS on the interface. 422.It Cm mtu Ar value 423Set the MTU for this device to the given 424.Ar value . 425Cloned routes inherit this value as a default. 426For Ethernet devices which support setting the MTU, 427a value greater than 1500 enables jumbo frames. 428The 429.Sy hardmtu 430output from 431.Cm hwfeatures 432shows the maximum supported MTU. 433.It Cm netmask Ar mask 434(inet and inet6 only) 435Specify how much of the address to reserve for subdividing 436networks into subnetworks. 437The mask includes the network part of the local address 438and the subnet part, which is taken from the host field of the address. 439The mask can be specified as a single hexadecimal number 440with a leading 0x, or with a dot-notation Internet address. 441The mask contains 1's for the bit positions in the 32-bit address 442which are to be used for the network and subnet parts, 443and 0's for the host part. 444The mask should contain at least the standard network portion, 445and the subnet field should be contiguous with the network 446portion. 447.It Cm prefixlen Ar n 448(inet and inet6 only) 449Effect is similar to 450.Cm netmask , 451but you can specify prefix length by digits. 452.It Cm priority Ar n 453Set the interface routing priority to 454.Ar n . 455.Ar n 456is in the range of 0 to 15 with smaller numbers being better. 457The default priority of an interface is 0, 458except for IEEE 802.11 wireless interfaces (priority 4) and 459.Xr carp 4 460interfaces (priority 15). 461The default priority of newly connected routes (routes created by 462configuring an IP address on an interface) is calculated by adding 4 463(RTP_CONNECTED) to the interface priority. 464The default priority of new static routes added to the kernel is 465calculated by adding 8 (RTP_STATIC) to the interface priority. 466.It Cm rdomain Ar rdomainid 467Attach the interface to the routing domain with the specified 468.Ar rdomainid . 469Interfaces in different routing domains are separated and cannot directly 470pass traffic between each other. 471It is therefore possible to reuse the same addresses in different routing 472domains. 473If the specified rdomain does not yet exist it will be created, including 474a routing table with the same id. 475By default all interfaces belong to routing domain 0. 476.It Cm -rdomain 477Remove the interface from the routing domain and return it to routing 478domain 0. 479Any inet and inet6 addresses on the interface will also be removed. 480.It Cm rtlabel Ar route-label 481(inet) 482Attach 483.Ar route-label 484to new network routes of the specified interface. 485Route labels can be used to implement policy routing; 486see 487.Xr route 4 , 488.Xr route 8 , 489and 490.Xr pf.conf 5 . 491.It Cm -rtlabel 492Clear the route label. 493.It Cm staticarp 494If ARP is enabled, the host will only reply to requests for its addresses, 495and will never send any requests. 496.It Cm -staticarp 497If ARP is enabled, the host will perform normally, 498sending out requests and listening for replies. 499.It Cm transceiver 500Query and display information and diagnostics from GBIC and SFP 501.\", or QSFP 502modules installed in an interface. 503It is only supported by drivers implementing the necessary functionality 504on hardware which supports it. 505.It Cm up 506Mark an interface 507.Dq up . 508This may be used to enable an interface after an 509.Cm ifconfig down . 510It happens automatically when setting the first address on an interface. 511If the interface was reset when previously marked down, 512the hardware will be re-initialized. 513.It Cm wol 514Enable Wake on LAN (WoL). 515When enabled, reception of a WoL frame will cause the network card to 516power up the system from standby or suspend mode. 517WoL frames are sent using 518.Xr arp 8 . 519.It Cm -wol 520Disable WoL. 521WoL is disabled at boot by the driver, if possible. 522.El 523.Sh BRIDGE 524The following options are available for a 525.Xr bridge 4 526interface: 527.Bl -tag -width Ds 528.It Cm add Ar interface 529Add 530.Ar interface 531as a member of the bridge. 532The interface is put into promiscuous mode so 533that it can receive every packet sent on the 534network. 535An interface can be a member of at most one bridge. 536.It Cm addr 537Display the addresses that have been learned by the bridge. 538.It Cm addspan Ar interface 539Add 540.Ar interface 541as a span port on the bridge. 542.It Cm autoedge Ar interface 543Automatically detect the spanning tree edge port status on 544.Ar interface . 545This is the default for interfaces added to the bridge. 546.It Cm -autoedge Ar interface 547Disable automatic spanning tree edge port detection on 548.Ar interface . 549.It Cm autoptp Ar interface 550Automatically detect the point-to-point status on 551.Ar interface 552by checking the full duplex link status. 553This is the default for interfaces added to the bridge. 554.It Cm -autoptp Ar interface 555Disable automatic point-to-point link detection on 556.Ar interface . 557.It Cm blocknonip Ar interface 558Mark 559.Ar interface 560so that only IPv4, IPv6, ARP, and Reverse 561ARP packets are accepted from it or forwarded to it from other 562bridge member interfaces. 563.It Cm -blocknonip Ar interface 564Allow non-IPv4, IPv6, ARP, or Reverse ARP packets through 565.Ar interface . 566.It Cm del Ar interface 567Remove 568.Ar interface 569from the bridge. 570Promiscuous mode is turned off for the interface when it is 571removed from the bridge. 572.It Cm deladdr Ar address 573Delete 574.Ar address 575from the cache. 576.It Cm delspan Ar interface 577Delete 578.Ar interface 579from the list of span ports of the bridge. 580.It Cm discover Ar interface 581Mark 582.Ar interface 583so that packets are sent out of the interface 584if the destination port of the packet is unknown. 585If the bridge has no address cache entry for the destination of 586a packet, meaning that there is no static entry and no dynamically learned 587entry for the destination, the bridge will forward the packet to all member 588interfaces that have this flag set. 589This is the default for interfaces added to the bridge. 590.It Cm -discover Ar interface 591Mark 592.Ar interface 593so that packets are not sent out of the interface 594if the destination port of the packet is unknown. 595Turning this flag 596off means that the bridge will not send packets out of this interface 597unless the packet is a broadcast packet, multicast packet, or a 598packet with a destination address found on the interface's segment. 599This, in combination with static address cache entries, 600prevents potentially sensitive packets from being sent on 601segments that have no need to see the packet. 602.It Cm down 603Stop the bridge from forwarding packets. 604.It Cm edge Ar interface 605Set 606.Ar interface 607as a spanning tree edge port. 608An edge port is a single connection to the network and cannot create 609bridge loops. 610This allows a straight transition to forwarding. 611.It Cm -edge Ar interface 612Disable edge port status on 613.Ar interface . 614.It Cm flush 615Remove all dynamically learned addresses from the cache. 616.It Cm flushall 617Remove all addresses from the cache including static addresses. 618.It Cm flushrule Ar interface 619Remove all Ethernet MAC filtering rules from 620.Ar interface . 621.It Cm fwddelay Ar time 622Set the time (in seconds) before an interface begins forwarding packets. 623Defaults to 15 seconds, minimum of 4, maximum of 30. 624.It Cm hellotime Ar time 625Set the time (in seconds) between broadcasting spanning tree protocol 626configuration packets. 627Defaults to 2 seconds, minimum of 1, maximum of 2. 628This option is only supported in STP mode with rapid transitions disabled; 629see the 630.Cm proto 631command for setting the protocol version. 632.It Cm holdcnt Ar time 633Set the transmit hold count, which is the number of spanning tree protocol 634packets transmitted before being rate limited. 635Defaults to 6, minimum of 1, maximum of 10. 636.It Cm ifcost Ar interface num 637Set the spanning tree path cost of 638.Ar interface 639to 640.Ar num . 641Defaults to 55, minimum of 1, maximum of 200000000 in RSTP mode, 642and maximum of 65535 in STP mode. 643.It Cm -ifcost Ar interface 644Automatically calculate the spanning tree priority of 645.Ar interface 646based on the current link speed, interface status, and spanning tree mode. 647This is the default for interfaces added to the bridge. 648.It Cm ifpriority Ar interface num 649Set the spanning tree priority of 650.Ar interface 651to 652.Ar num . 653Defaults to 128, minimum of 0, maximum of 240. 654.It Cm learn Ar interface 655Mark 656.Ar interface 657so that the source address of packets received from 658the interface 659are entered into the address cache. 660This is the default for interfaces added to the bridge. 661.It Cm -learn Ar interface 662Mark 663.Ar interface 664so that the source address of packets received from interface 665are not entered into the address cache. 666.It Cm link0 667Setting this flag stops all IP multicast packets from 668being forwarded by the bridge. 669.It Cm -link0 670Clear the 671.Cm link0 672flag on the bridge interface. 673.It Cm link1 674Setting this flag stops all non-IP multicast packets from 675being forwarded by the bridge. 676.It Cm -link1 677Clear the 678.Cm link1 679flag on the bridge interface. 680.It Cm link2 681Setting this flag causes all packets to be passed on to 682.Xr ipsec 4 683for processing, based on the policies established by the administrator 684using the 685.Xr ipsecctl 8 686command and 687.Xr ipsec.conf 5 . 688If appropriate security associations (SAs) exist, they will be used to 689encrypt or decrypt the packets. 690Otherwise, any key management daemons such as 691.Xr isakmpd 8 692that are running on the bridge will be invoked to establish the 693necessary SAs. 694These daemons have to be configured as if they were running on the 695host whose traffic they are protecting (i.e. they need to have the 696appropriate authentication and authorization material, such as keys 697and certificates, to impersonate the protected host(s)). 698.It Cm -link2 699Clear the 700.Cm link2 701flag on the bridge interface. 702.It Cm maxaddr Ar size 703Set the address cache size to 704.Ar size . 705The default is 100 entries. 706.It Cm maxage Ar time 707Set the time (in seconds) that a spanning tree protocol configuration is valid. 708Defaults to 20 seconds, minimum of 6, maximum of 40. 709.It Cm protected Ar interface ids 710Put 711.Ar interface 712in protected domains. 713.Ar ids 714is a comma delimited list of domain IDs, between 1 and 31, to put the 715interface in. 716Interfaces that are part of a protected domain cannot forward traffic to any 717other interface in that domain. 718Interfaces do not belong to any protected domain by default. 719.It Cm -protected Ar interface 720Remove 721.Ar interface 722from all protected domains. 723.It Cm proto Ar value 724Force the spanning tree protocol version. 725The available values are 726.Ar rstp 727to operate in the default Rapid Spanning Tree (RSTP) mode 728or 729.Ar stp 730to force operation in Spanning Tree (STP) mode with rapid transitions disabled. 731.It Cm ptp Ar interface 732Set 733.Ar interface 734as a point-to-point link. 735This is required for straight transitions to forwarding and 736should be enabled for a full duplex link or a 737.Xr trunk 4 738with at least two physical links to the same network segment. 739.It Cm -ptp Ar interface 740Disable point-to-point link status on 741.Ar interface . 742This should be disabled for a half duplex link and for an interface 743connected to a shared network segment, 744like a hub or a wireless network. 745.It Xo 746.Cm rule 747.Cm block Ns | Ns Cm pass 748.Op Cm in | out 749.Cm on Ar interface 750.Op Cm src Ar lladdr 751.Op Cm dst Ar lladdr 752.Bk -words 753.Op Cm tag Ar tagname 754.Oo 755.Cm arp Ns | Ns Cm rarp Op Cm request | reply 756.Op Cm sha Ar lladdr 757.Op Cm spa Ar ipaddr 758.Op Cm tha Ar lladdr 759.Op Cm tpa Ar ipaddr 760.Oc 761.Ek 762.Xc 763Add a filtering rule to an interface. 764Rules have a similar syntax to those in 765.Xr pf.conf 5 . 766Rules can be used to selectively 767.Cm block 768or 769.Cm pass 770frames based on Ethernet 771MAC addresses or to 772.Cm tag 773packets for 774.Xr pf 4 775to filter on. 776.Pp 777.Xr arp 4 778packets can be matched with the 779.Cm arp 780keyword for regular packets and 781.Cm rarp 782for reverse arp. 783.Cm request 784and 785.Cm reply 786limit matches to requests or replies. 787The source and target host addresses can be matched with the 788.Cm sha 789and 790.Cm tha 791keywords, 792and the protocol addresses with 793.Cm spa 794and 795.Cm tpa . 796.Pp 797Rules are processed in the order in which they were added to the interface. 798The first rule matched takes the action (block or pass) 799and, if given, the tag of the rule. 800If no source or destination address is specified, the 801rule will match all frames (good for creating a catchall policy). 802.It Cm rulefile Ar filename 803Load a set of rules from the file 804.Ar filename . 805.It Cm rules Ar interface 806Display the active filtering rules in use on 807.Ar interface . 808.It Cm spanpriority Ar num 809Set the spanning priority of this bridge to 810.Ar num . 811Defaults to 32768, minimum of 0, maximum of 61440. 812.It Cm static Ar interface address 813Add a static entry into the address cache pointing to 814.Ar interface . 815Static entries are never aged out of the cache or replaced, even if the address 816is seen on a different interface. 817.It Cm stp Ar interface 818Enable spanning tree protocol on 819.Ar interface . 820.It Cm -stp Ar interface 821Disable spanning tree protocol on 822.Ar interface . 823This is the default for interfaces added to the bridge. 824.It Cm timeout Ar time 825Set the timeout, in seconds, for addresses in the cache to 826.Ar time . 827The default is 240 seconds. 828If 829.Ar time 830is set to zero, then entries will not be expired. 831.It Cm up 832Start the bridge forwarding packets. 833.El 834.Sh CARP 835.nr nS 1 836.Bk -words 837.Nm ifconfig 838.Ar carp-interface 839.Op Cm advbase Ar n 840.Op Cm advskew Ar n 841.Op Cm balancing Ar mode 842.Op Cm carpnodes Ar vhid:advskew,vhid:advskew,... 843.Op Cm carpdev Ar iface 844.Op Oo Fl Oc Ns Cm carppeer Ar peer_address 845.Op Cm pass Ar passphrase 846.Op Cm state Ar state 847.Op Cm vhid Ar host-id 848.Ek 849.nr nS 0 850.Pp 851The following options are available for a 852.Xr carp 4 853interface: 854.Bl -tag -width Ds 855.It Cm advbase Ar n 856Set the base advertisement interval to 857.Ar n 858seconds. 859Acceptable values are 0 to 254; the default value is 1 second. 860.It Cm advskew Ar n 861Skew the advertisement interval by 862.Ar n . 863Acceptable values are 0 to 254; the default value is 0. 864.It Cm balancing Ar mode 865Set the load balancing mode to 866.Ar mode . 867Valid modes are 868.Cm ip , 869.Cm ip-stealth , 870and 871.Cm ip-unicast . 872.It Cm carpnodes Ar vhid:advskew,vhid:advskew,... 873Create a load balancing group consisting of up to 32 nodes. 874Each node is specified as a 875.Ar vhid:advskew 876tuple in a comma-separated list. 877.It Cm carpdev Ar iface 878Attach to parent interface 879.Ar iface . 880.It Cm carppeer Ar peer_address 881Send the carp advertisements to a specified 882point-to-point peer or multicast group instead of sending the messages 883to the default carp multicast group. 884The 885.Ar peer_address 886is the IP address of the other host taking part in the carp cluster. 887With this option, 888.Xr carp 4 889traffic can be protected using 890.Xr ipsec 4 891and it may be desired in networks that do not allow or have problems 892with IPv4 multicast traffic. 893.It Cm -carppeer 894Send the advertisements to the default carp multicast 895group. 896.It Cm pass Ar passphrase 897Set the authentication key to 898.Ar passphrase . 899There is no passphrase by default. 900.It Cm state Ar state 901Explicitly force the interface to enter this state. 902Valid states are 903.Ar init , 904.Ar backup , 905and 906.Ar master . 907.It Cm vhid Ar n 908Set the virtual host ID to 909.Ar n . 910Acceptable values are 1 to 255. 911.El 912.Pp 913Taken together, the 914.Cm advbase 915and 916.Cm advskew 917indicate how frequently, in seconds, the host will advertise the fact that it 918considers itself master of the virtual host. 919The formula is 920.Cm advbase 921+ 922.Pf ( Cm advskew 923/ 256). 924If the master does not advertise within three times this interval, this host 925will begin advertising as master. 926.Sh IEEE 802.11 (WIRELESS DEVICES) 927.nr nS 1 928.Bk -words 929.Nm ifconfig 930.Ar wireless-interface 931.Op Oo Fl Oc Ns Cm bssid Ar bssid 932.Op Oo Fl Oc Ns Cm chan Op Ar n 933.Op Oo Fl Oc Ns Cm join Ar id 934.Op Oo Fl Oc Ns Cm joinlist 935.Op Oo Fl Oc Ns Cm nwflag Ar flag 936.Op Oo Fl Oc Ns Cm nwid Ar id 937.Op Oo Fl Oc Ns Cm nwkey Ar key 938.Op Oo Fl Oc Ns Cm powersave Op Ar duration 939.Op Cm scan 940.Op Oo Fl Oc Ns Cm wpa 941.Op Cm wpaakms Ar akm,akm,... 942.Op Cm wpaciphers Ar cipher,cipher,... 943.Op Cm wpagroupcipher Ar cipher 944.Op Oo Fl Oc Ns Cm wpakey Ar passphrase | hexkey 945.Op Cm wpaprotos Ar proto,proto,... 946.Ek 947.nr nS 0 948.Pp 949The following options are available for a wireless interface: 950.Bl -tag -width Ds 951.It Cm bssid Ar bssid 952Set the desired BSSID. 953.It Cm -bssid 954Unset the desired BSSID. 955The interface will automatically select a BSSID in this mode, which is 956the default. 957.It Cm chan Op Ar n 958Set the channel (radio frequency) to 959.Ar n . 960.Pp 961With no channel specified, 962show the list of channels supported by the device. 963.It Cm -chan 964Unset the desired channel. 965It doesn't affect the channel to be created for IBSS or Host AP mode. 966.It Cm join Ar id 967Add the network with ESSID 968.Ar id 969to the 970.Cm join 971list. 972The interface will automatically attempt to connect to networks on this 973list if they are found during a scan. 974.Pp 975The 976.Ar id 977can either be a printable ASCII string up to 32 characters in length, 978or a series of hexadecimal digits up to 64 digits preceded by 979.Dq 0x . 980If 981.Ar id 982is the empty string 983.Pq Qq 984and none of the networks on the 985.Cm join 986list are found during a scan, the interface will automatically 987connect to any available networks, provided they do not require 988WEP or WPA authentication. 989.Pp 990Apart from the 991.Ar id , 992the 993.Cm join 994list will record 995.Cm wpakey , 996.Cm wpaprotos , 997or 998.Cm nwkey 999parameters for the network, provided they are passed in the same invocation of 1000.Nm . 1001Because multiple access points may exist in a given network, the 1002.Cm mode 1003(11a/11b/11g/11n), 1004.Cm chan , 1005and 1006.Cm bssid 1007parameters cannot be stored with 1008.Cm join . 1009However, they may be used separately to force the selection of a 1010particular access point when the automatic access point selection 1011turns out to be suboptimal. 1012.Pp 1013.Cm join 1014and 1015.Cm nwid 1016cannot be used together in the same invocation of 1017.Nm . 1018.It Cm -join Ar id 1019Remove the network with ESSID 1020.Ar id 1021from the 1022.Cm join 1023list and disconnect the interface from the access point if it is currently 1024connected to this network. 1025The interface will keep scanning for access points as long as it remains 1026marked as 1027.Dq up . 1028A new connection will be established either if a network on the 1029.Cm join 1030list is found during the scan or if a network ID is configured with 1031.Cm nwid . 1032.It Cm joinlist 1033Show the list of networks stored on the 1034.Cm join 1035list. 1036.It Cm -joinlist 1037Remove all networks from the 1038.Cm join 1039list. 1040.It Cm nwflag Ar flag 1041Set specified flag. 1042The flag name can be: 1043.Bl -tag -width tenletters 1044.It hidenwid 1045The 1046.Ql hidenwid 1047flag will hide the network ID (ESSID) in beacon frames when operating 1048in Host AP mode. 1049It will also prevent responses to probe requests with an unspecified 1050network ID. 1051.It nobridge 1052The 1053.Ql nobridge 1054flag will disable the direct bridging of frames between associated 1055nodes when operating in Host AP mode. 1056Setting this flag will block and filter direct inter-station 1057communications. 1058.It nomimo 1059The 1060.Ql nomimo 1061flag will disable MIMO reception and transmission even if the driver 1062and wireless network device support MIMO. 1063This flag can be used to work around packet loss in 11n mode if the 1064wireless network device has unused antenna connectors. 1065.It stayauth 1066The 1067.Ql stayauth 1068flag will cause the interface to ignore deauth frames. 1069This flag should only be used on wifi networks which are being 1070attacked with spoofed deauth frames. 1071It breaks interoperability with spectrum management solutions and access 1072points that perform band-steering of clients. 1073.El 1074.Pp 1075Note that the 1076.Ql hidenwid 1077and 1078.Ql nobridge 1079options do not provide any security. 1080The hidden network ID will be sent in clear text by associating 1081stations and can be easily discovered with tools like 1082.Xr tcpdump 8 1083and 1084.Xr hostapd 8 . 1085.It Cm -nwflag Ar flag 1086Remove specified flag. 1087.It Cm nwid Ar id 1088Connect to the network with NWID/ESSID 1089.Ar id . 1090The 1091.Ar id 1092can either be a printable ASCII string up to 32 characters in length, 1093or a series of hexadecimal digits up to 64 digits preceded by 1094.Dq 0x . 1095.Pp 1096Unlike 1097.Cm join , 1098the 1099.Cm nwid 1100option only allows one network to be configured at a time. 1101The 1102.Cm nwid 1103option may not be used together with 1104.Cm join 1105in the same invocation of 1106.Nm 1107but may be used to momentarily override the automatic selection of 1108networks stored in the 1109.Cm join 1110list. 1111.It Cm -nwid 1112Clear the network ID configured with 1113.Cm nwid 1114and disconnect the interface from the access point if it is currently 1115connected to this network. 1116The interface will keep scanning for access points as long as it remains 1117marked as 1118.Dq up . 1119A new connection will be established either if a network on the 1120.Cm join 1121list is found during the scan or if a network ID is configured with 1122.Cm nwid . 1123.It Cm nwkey Ar key 1124Enable WEP encryption using the specified 1125.Ar key . 1126The 1127.Ar key 1128can either be a string, a series of hexadecimal digits (preceded by 1129.So 0x Sc ) , 1130or a set of keys 1131of the form 1132.Dq n:k1,k2,k3,k4 1133where 1134.Sq n 1135specifies which of the keys will be used for transmitted packets, 1136and the four keys, 1137.Dq k1 1138through 1139.Dq k4 , 1140are configured as WEP keys. 1141If a set of keys is specified, a comma 1142.Pq Sq \&, 1143within the key must be escaped with a backslash. 1144Note that if multiple keys are used, their order must be the same within 1145the network. 1146.Pp 1147The length of each key must be either 40 bits for 64-bit encryption 1148(5-character ASCII string 1149or 10 hexadecimal digits) 1150or 104 bits for 128-bit encryption 1151(13-character ASCII string 1152or 26 hexadecimal digits). 1153.It Cm -nwkey 1154Disable WEP encryption. 1155.It Cm nwkey Cm persist 1156Enable WEP encryption using the persistent key stored in the network card. 1157.It Cm nwkey Cm persist : Ns Ar key 1158Write 1159.Ar key 1160to the persistent memory of the network card, and 1161enable WEP encryption using that 1162.Ar key . 1163.It Cm powersave 1164Enable 802.11 power saving mode. 1165Power saving is disabled by default. 1166See driver specific manual pages 1167to see details of the implementation relevant to that device. 1168.\" XXX 1169.\" Undocumented because optional sleep period 1170.\" only configurable on legacy an(4) and atw(4) devices. 1171.\" XXX 1172.\" Op Ar duration 1173.\" If enabled, the receiver sleep period is set to 100ms, 1174.\" though some drivers allow this to be altered via the 1175.\" .Ar duration 1176.\" argument. 1177.It Cm -powersave 1178Disable 802.11 power saving mode. 1179.It Cm scan 1180Show the results of an access point scan. 1181In Host AP mode, this will dump the list of known nodes without scanning. 1182In station mode, this will list each access point's SSID, channel, 1183MAC address (BSSID), received signal strength indicator, maximum data 1184transfer rate, and supported feature flags. 1185If an access point cannot be selected due to incompatibilities with the 1186interface configuration, 1187.Nm 1188indicates mismatching configuration items with an exclamation mark. 1189.Pp 1190Because the list of access points is continuously updated while a scan 1191is in progress, 1192.Cm scan 1193may sometimes show incomplete scan results. 1194.Pp 1195Some interfaces support scanning in the background while remaining 1196associated to the current access point. 1197The superuser may use 1198.Cm scan 1199to trigger a background scan while associated, which will update the scan 1200result list and also trigger a search for a better access point to roam to. 1201.It Cm wpa 1202Enable Wi-Fi Protected Access. 1203WPA is a Wi-Fi Alliance protocol based on the IEEE 802.11i standard. 1204It was designed to enhance the security of wireless networks. 1205Notice that not all drivers support WPA. 1206Check the driver's manual page to know if this option is supported. 1207.It Cm -wpa 1208Disable Wi-Fi Protected Access. 1209.It Cm wpaakms Ar akm,akm,... 1210Set the comma-separated list of allowed authentication and key management 1211protocols. 1212.Pp 1213The supported values are 1214.Dq psk 1215and 1216.Dq 802.1x . 1217.Ar psk 1218authentication (also known as personal mode) uses a 256-bit pre-shared key. 1219.Ar 802.1x 1220authentication (also known as enterprise mode) is used with 1221an external IEEE 802.1X authentication server, 1222such as wpa_supplicant. 1223The default value is 1224.Dq psk . 1225.Dq psk 1226can only be used if a pre-shared key is configured using the 1227.Cm wpakey 1228option. 1229.It Cm wpaciphers Ar cipher,cipher,... 1230Set the comma-separated list of allowed pairwise ciphers. 1231.Pp 1232The supported values are 1233.Dq tkip , 1234.Dq ccmp , 1235and 1236.Dq usegroup . 1237.Ar usegroup 1238specifies that no pairwise ciphers are supported and that only group keys 1239should be used. 1240The default value is 1241.Dq ccmp . 1242If multiple pairwise ciphers are specified, the pairwise cipher will 1243be negotiated between the station and the access point at association 1244time. 1245A station will always try to use 1246.Ar ccmp 1247over 1248.Ar tkip 1249if both ciphers are allowed and supported by the access point. 1250If the selected cipher is not supported by the hardware, software 1251encryption will be used. 1252Check the driver's manual page to know which ciphers are supported in 1253hardware. 1254.It Cm wpagroupcipher Ar cipher 1255Set the group cipher used to encrypt broadcast and multicast traffic. 1256.Pp 1257The supported values are 1258.Dq wep40 , 1259.Dq wep104 , 1260.Dq tkip , 1261and 1262.Dq ccmp . 1263The default value is 1264.Dq ccmp . 1265The use of 1266.Ar tkip 1267or 1268.Ar wep40 1269or 1270.Ar wep104 1271as the group cipher is discouraged due to weaknesses in TKIP and WEP. 1272The 1273.Cm wpagroupcipher 1274option is available in Host AP mode only. 1275A station will always use the group cipher of the BSS. 1276.It Cm wpakey Ar passphrase | hexkey 1277Set the WPA key and enable WPA. 1278The key can be given using either a passphrase or a full length hex key, 1279starting with 0x. 1280If a passphrase is used the 1281.Cm nwid 1282or 1283.Cm join 1284option must first be specified, since 1285.Nm 1286will hash the nwid along with the passphrase to create the key. 1287.It Cm -wpakey 1288Delete the pre-shared WPA key and disable WPA. 1289.It Cm wpaprotos Ar proto,proto,... 1290Set the comma-separated list of allowed WPA protocol versions. 1291.Pp 1292The supported values are 1293.Dq wpa1 1294and 1295.Dq wpa2 . 1296.Ar wpa1 1297is based on draft 3 of the IEEE 802.11i standard whereas 1298.Ar wpa2 1299is based on the ratified standard. 1300The default value is 1301.Dq wpa2 . 1302If 1303.Dq wpa1,wpa2 1304is specified, a station will always use the 1305.Ar wpa2 1306protocol when supported by the access point. 1307.El 1308.Sh INET6 1309.nr nS 1 1310.Bk -words 1311.Nm ifconfig 1312.Ar interface 1313.Cm inet6 1314.Op Oo Fl Oc Ns Cm anycast 1315.Op Oo Fl Oc Ns Cm autoconfprivacy 1316.Op Cm eui64 1317.Op Cm pltime Ar n 1318.Op Oo Fl Oc Ns Cm soii 1319.Op Oo Fl Oc Ns Cm tentative 1320.Op Cm vltime Ar n 1321.Ek 1322.nr nS 0 1323.Pp 1324The following options are available for an 1325.Xr ip6 4 1326interface: 1327.Bl -tag -width Ds 1328.It Cm anycast 1329Set the IPv6 anycast address bit. 1330.It Cm -anycast 1331Clear the IPv6 anycast address bit. 1332.It Cm autoconfprivacy 1333Enable privacy extensions for stateless IPv6 address autoconfiguration 1334(RFC 4941) on the interface. 1335These extensions are enabled by default. 1336The purpose of these extensions is to prevent tracking of individual 1337devices which connect to the IPv6 internet from different networks 1338using stateless autoconfiguration. 1339The interface identifier often remains constant and provides the lower 134064 bits of an autoconfigured IPv6 address, facilitating tracking of 1341individual devices (and hence, potentially, users of these devices) 1342over long periods of time (weeks to months to years). 1343When these extensions are active, random interface identifiers are used 1344for autoconfigured addresses. 1345.Pp 1346Autoconfigured addresses are also made temporary, which means that they 1347will automatically be replaced regularly. 1348Temporary addresses are deprecated after 24 hours. 1349Once a temporary address has been deprecated, a new temporary address 1350will be configured upon reception of a router advertisement indicating 1351that the prefix is still valid. 1352Deprecated addresses will not be used for new connections as long as a 1353non-deprecated address remains available. 1354Temporary addresses become invalid after one week, at which time they 1355will be removed from the interface. 1356Address lifetime extension through router advertisements is ignored 1357for temporary addresses. 1358.It Cm -autoconfprivacy 1359Disable IPv6 autoconf privacy extensions on the interface. 1360Currently configured addresses will not be removed until they become 1361invalid. 1362.It Cm eui64 1363Fill the interface index 1364.Pq the lowermost 64 bits of an IPv6 address 1365automatically. 1366.It Cm pltime Ar n 1367Set preferred lifetime for the address, in seconds. 1368.It Cm soii 1369Enable persistent Semantically Opaque Interface Identifiers (SOIIs), 1370as per RFC 7217, for SLAAC addresses on the interface. 1371The purpose of these identifiers is to make discovery of hosts by 1372scanning a whole prefix more difficult. 1373SOIIs use the whole 64 bits of the host part while SLAAC addresses are 1374formed from MAC addresses which can lower the entropy to 24 bits if 1375the host is running in a virtualization environment or the hardware 1376manufacturer is known. 1377See RFC 7721 and RFC 8064 for details. 1378SOIIs are enabled by default. 1379.It Cm -soii 1380Disable IPv6 persistent Semantically Opaque Interface Identifiers on the 1381interface. 1382Currently configured addresses will not be removed until they become 1383invalid. 1384.It Cm tentative 1385Set the IPv6 tentative address bit. 1386.It Cm -tentative 1387Clear the IPv6 tentative address bit. 1388.It Cm vltime Ar n 1389Set valid lifetime for the address, in seconds. 1390.El 1391.Sh INTERFACE GROUPS 1392.Nm ifconfig 1393.Fl g 1394.Ar group-name 1395.Oo 1396.Oo Fl Oc Ns Cm carpdemote 1397.Op Ar number 1398.Oc 1399.Pp 1400The following options are available for interface groups: 1401.Bl -tag -width Ds 1402.It Fl g Ar group-name 1403Specify the group. 1404.It Cm carpdemote Op Ar number 1405Increase 1406.Xr carp 4 1407demote count for given interface group by 1408.Ar number . 1409Acceptable values are 0 to 128. 1410If 1411.Ar number 1412is omitted, it is increased by 1. 1413Demote count can be set up to 255. 1414.It Cm -carpdemote Op Ar number 1415Decrease 1416.Xr carp 4 1417demote count for given interface group by 1418.Ar number . 1419Acceptable values are 0 to 128. 1420If 1421.Ar number 1422is omitted, it is decreased by 1. 1423.El 1424.Sh MPLS 1425.nr nS 1 1426.Bk -words 1427.Nm ifconfig 1428.Ar mpls-interface 1429.Op Cm mplslabel Ar mpls-label 1430.Op Oo Fl Oc Ns Cm pwecw 1431.Op Oo Fl Oc Ns Cm pwefat 1432.Op Cm pweneighbor Ar mpls-label Ar neighbor 1433.Op Cm tunneldomain Ar rdomain 1434.Ek 1435.nr nS 0 1436.Pp 1437The following options are available for 1438.Xr mpe 4 , 1439.Xr mpip 4 , 1440and 1441.Xr mpw 4 1442interfaces: 1443.Bl -tag -width Ds 1444.It Cm mplslabel Ar mpls-label 1445Set the local MPLS label to 1446.Ar mpls-label . 1447MPLS packets sent to this label on the local system will be 1448decapsulated for input. 1449An MPLS label is a 20-bit number. 1450Labels 0 to 15 inclusive are reserved labels and cannot be used. 1451.It Cm tunneldomain Ar rdomain 1452Use the route domain 1453.Ar rdomain 1454for MPLS transit. 1455The MPLS encapsulated traffic does not need to terminate in the same 1456routing domain as the interface itself. 1457.El 1458.Pp 1459The following options are available for the 1460.Xr mpip 4 1461and 1462.Xr mpw 4 1463interfaces that provide MPLS Pseudowire Emulation Edge-to-Edge (PWE3) 1464functionality: 1465.Bl -tag -width Ds 1466.It Cm pwecw 1467Enable the use of the PWE3 Control Word. 1468.It Fl Ns Cm pwecw 1469Disable the use of the PWE3 Control Word. 1470.It Cm pwefat 1471Enable the use of the Flow-Aware Transport (FAT) flow label. 1472.It Fl Ns Cm pwefat 1473Disable the use of the Flow-Aware Transport (FAT) flow label. 1474.It Cm pweneighbor Ar mpls-label Ar neighbor 1475Use 1476.Ar mpls-label 1477and 1478.Ar neighbor 1479as the remote MPLS label and neighbor respectively. 1480Remote MPLS labels have the same restrictions on values as local MPLS labels. 1481.El 1482.Sh PAIR 1483.nr nS 1 1484.Bk -words 1485.Nm ifconfig 1486.Ar pair-interface 1487.Op Oo Fl Oc Ns Cm patch Ar interface 1488.Ek 1489.nr nS 0 1490.Pp 1491The following options are available for a 1492.Xr pair 4 1493interface: 1494.Bl -tag -width Ds 1495.It Cm patch Ar interface 1496Connect the interface with a second 1497.Xr pair 4 1498interface. 1499Any outgoing packets from the first 1500.Ar pair-interface 1501will be received by the second 1502.Ar interface , 1503and vice versa. 1504This makes it possible to interconnect two routing domains locally. 1505.It Cm -patch 1506If configured, disconnect the interface pair. 1507.El 1508.Sh PFLOW 1509.nr nS 1 1510.Bk -words 1511.Nm ifconfig 1512.Ar pflow-interface 1513.Op Oo Fl Oc Ns Cm flowdst Ar addr : Ns Ar port 1514.Op Oo Fl Oc Ns Cm flowsrc Ar addr Ns Oo : Ns Ar port Oc 1515.Op Cm pflowproto Ar n 1516.Ek 1517.nr nS 0 1518.Pp 1519The following options are available for a 1520.Xr pflow 4 1521interface: 1522.Bl -tag -width Ds 1523.It Cm flowdst Ar addr : Ns Ar port 1524Set the receiver address and the port for 1525.Xr pflow 4 1526packets. 1527Both must be defined to export pflow data. 1528.Ar addr 1529is the IP address and 1530.Ar port 1531is the port number of the flow collector. 1532Pflow data will be sent to this address/port. 1533.It Cm -flowdst 1534Unset the receiver address and stop sending pflow data. 1535.It Cm flowsrc Ar addr Ns Oo : Ns Ar port Oc 1536Set the source IP address for pflow packets. 1537.Ar addr 1538is the IP address used as sender of the UDP packets and may be used to 1539identify the source of the data on the pflow collector. 1540.It Cm -flowsrc 1541Unset the source address. 1542.It Cm pflowproto Ar n 1543Set the protocol version. 1544The default is version 5. 1545.El 1546.Sh PFSYNC 1547.nr nS 1 1548.Bk -words 1549.Nm ifconfig 1550.Ar pfsync-interface 1551.Op Oo Fl Oc Ns Cm defer 1552.Op Cm maxupd Ar n 1553.Op Oo Fl Oc Ns Cm syncdev Ar iface 1554.Op Oo Fl Oc Ns Cm syncpeer Ar peer_address 1555.Ek 1556.nr nS 0 1557.Pp 1558The following options are available for a 1559.Xr pfsync 4 1560interface: 1561.Bl -tag -width Ds 1562.It Cm defer 1563Defer transmission of the first packet in a state until a peer has 1564acknowledged that the associated state has been inserted. 1565See 1566.Xr pfsync 4 1567for more information. 1568.It Cm -defer 1569Do not defer the first packet in a state. 1570This is the default. 1571.It Cm maxupd Ar n 1572Indicate the maximum number 1573of updates for a single state which can be collapsed into one. 1574This is an 8-bit number; the default value is 128. 1575.It Cm syncdev Ar iface 1576Use the specified interface 1577to send and receive pfsync state synchronisation messages. 1578.It Cm -syncdev 1579Stop sending pfsync state synchronisation messages over the network. 1580.It Cm syncpeer Ar peer_address 1581Make the pfsync link point-to-point rather than using 1582multicast to broadcast the state synchronisation messages. 1583The peer_address is the IP address of the other host taking part in 1584the pfsync cluster. 1585With this option, 1586.Xr pfsync 4 1587traffic can be protected using 1588.Xr ipsec 4 . 1589.It Cm -syncpeer 1590Broadcast the packets using multicast. 1591.El 1592.Sh PPPOE 1593.nr nS 1 1594.Bk -words 1595.Nm ifconfig 1596.Ar pppoe-interface 1597.Op Cm authkey Ar key 1598.Op Cm authname Ar name 1599.Op Cm authproto Ar proto 1600.Op Oo Fl Oc Ns Cm peerflag Ar flag 1601.Op Cm peerkey Ar key 1602.Op Cm peername Ar name 1603.Op Cm peerproto Ar proto 1604.Op Oo Fl Oc Ns Cm pppoeac Ar access-concentrator 1605.Op Cm pppoedev Ar parent-interface 1606.Op Oo Fl Oc Ns Cm pppoesvc Ar service 1607.Ek 1608.nr nS 0 1609.Pp 1610.Xr pppoe 4 1611uses the 1612.Xr sppp 4 1613"generic" SPPP framework. 1614Any options not described in the section immediately following 1615are described in the 1616.Sx SPPP 1617section, below. 1618.Pp 1619The following options are available for a 1620.Xr pppoe 4 1621interface: 1622.Bl -tag -width Ds 1623.It Cm pppoeac Ar access-concentrator 1624Set the name of the access-concentrator. 1625.It Cm -pppoeac 1626Clear a previously set access-concentrator name. 1627.It Cm pppoedev Ar parent-interface 1628Set the name of the interface through which 1629packets will be transmitted and received. 1630.It Cm pppoesvc Ar service 1631Set the service name of the interface. 1632.It Cm -pppoesvc 1633Clear a previously set service name. 1634.El 1635.Sh SPPP (PPP LINK CONTROL PROTOCOL) 1636.nr nS 1 1637.Bk -words 1638.Nm 1639.Ar sppp-interface 1640.Op Cm authkey Ar key 1641.Op Cm authname Ar name 1642.Op Cm authproto Ar proto 1643.Op Oo Fl Oc Ns Cm peerflag Ar flag 1644.Op Cm peerkey Ar key 1645.Op Cm peername Ar name 1646.Op Cm peerproto Ar proto 1647.Ek 1648.nr nS 0 1649.Pp 1650The following options are available for an 1651.Xr sppp 4 1652or 1653.Xr pppoe 4 1654interface: 1655.Bl -tag -width Ds 1656.It Cm authkey Ar key 1657Set the client key or password for the PPP authentication protocol. 1658.It Cm authname Ar name 1659Set the client name for the PPP authentication protocol. 1660.It Cm authproto Ar proto 1661Set the PPP authentication protocol on the specified 1662interface acting as a client. 1663The protocol name can be either 1664.Ql chap , 1665.Ql pap , 1666or 1667.Ql none . 1668In the latter case, authentication will be turned off. 1669.It Cm peerflag Ar flag 1670Set a specified PPP flag for the remote authenticator. 1671The flag name can be either 1672.Ql callin 1673or 1674.Ql norechallenge . 1675The 1676.Ql callin 1677flag will require the remote peer to authenticate only when he's 1678calling in, but not when the peer is called by the local client. 1679This is required for some peers that do not implement the 1680authentication protocols symmetrically. 1681The 1682.Ql norechallenge 1683flag is only meaningful with the CHAP protocol to not re-challenge 1684once the initial CHAP handshake has been successful. 1685This is used to work around broken peer implementations that can't 1686grok being re-challenged once the connection is up. 1687.It Cm -peerflag Ar flag 1688Remove a specified PPP flag for the remote authenticator. 1689.It Cm peerkey Ar key 1690Set the authenticator key or password for the PPP authentication protocol. 1691.It Cm peername Ar name 1692Set the authenticator name for the PPP authentication protocol. 1693.It Cm peerproto Ar proto 1694Set the PPP authentication protocol on the specified 1695interface acting as an authenticator. 1696The protocol name can be either 1697.Ql chap , 1698.Ql pap , 1699or 1700.Ql none . 1701In the latter case, authentication will be turned off. 1702.El 1703.Sh SWITCH 1704The following options are available for a 1705.Xr switch 4 1706interface: 1707.Bl -tag -width Ds 1708.It Cm add Ar interface 1709Add 1710.Ar interface 1711as a member of the switch. 1712The interface is put into promiscuous mode so 1713that it can receive every packet sent on the 1714network. 1715An interface can be a member of at most one switch. 1716.It Cm addlocal Ar interface 1717Add 1718.Ar interface 1719as a local port of the switch. 1720Local port is a special port connected with the local system's network stack. 1721Only 1722.Xr vether 4 1723can be used for the 1724.Ar interface . 1725Only one interface can be added as a local port. 1726.It Cm datapath Ar id 1727Configure the datapath ID for the switch. 1728The default value is generated randomly. 1729.It Cm del Ar interface 1730Remove 1731.Ar interface 1732from the switch. 1733Promiscuous mode is turned off for the interface when it is removed 1734from the switch. 1735.It Cm maxflow Ar number 1736Set the maximum number of flows per table. 1737The default value is 10000. 1738.It Cm maxgroup Ar number 1739Set the maximum number of groups. 1740The default value is 1000. 1741.It Cm portno Ar interface number 1742Set the port number for the port named 1743.Ar interface . 1744The default value is the interface index of the 1745.Ar interface . 1746.It Cm protected Ar interface ids 1747Put 1748.Ar interface 1749in protected domains. 1750.Ar ids 1751is a comma delimited list of domain IDs, between 1 and 31, to put the 1752interface in. 1753Interfaces that are part of a protected domain cannot forward traffic to any 1754other interface in that domain. 1755Interfaces do not belong to any protected domain by default. 1756.It Cm -protected Ar interface 1757Remove 1758.Ar interface 1759from all protected domains. 1760.It Cm up 1761Start the switch processing packets. 1762.El 1763.Sh TRUNK (LINK AGGREGATION) 1764.Nm ifconfig 1765.Ar trunk-interface 1766.Op Cm lacpmode Cm active Ns | Ns Cm passive 1767.Op Cm lacptimeout Cm fast Ns | Ns Cm slow 1768.Op Oo Fl Oc Ns Cm trunkport Ar child-iface 1769.Op Cm trunkproto Ar proto 1770.Pp 1771The following options are available for 1772.Xr aggr 4 1773and 1774.Xr trunk 4 1775interfaces: 1776.Bl -tag -width Ds 1777.It Cm lacpmode Cm active Ns | Ns Cm passive 1778Set the LACP trunk mode to either 1779.Cm active 1780or 1781.Cm passive . 1782.It Cm lacptimeout Cm fast Ns | Ns Cm slow 1783Set the LACP timeout speed to either 1784.Cm fast 1785or 1786.Cm slow . 1787.It Cm trunkport Ar child-iface 1788Add 1789.Ar child-iface 1790as a trunk port. 1791.It Cm -trunkport Ar child-iface 1792Remove the trunk port 1793.Ar child-iface . 1794.It Cm trunkproto Ar proto 1795Set the link aggregation protocol on 1796.Xr trunk 4 1797interfaces. 1798Refer to 1799.Xr trunk 4 1800for a complete list of the available protocols. 1801.El 1802.Sh TUNNEL 1803.nr nS 1 1804.Bk -words 1805.Nm ifconfig 1806.Ar tunnel-interface 1807.Op Oo Fl Oc Ns Cm keepalive Ar period count 1808.Op Cm rxprio Ar prio 1809.Op Oo Fl Oc Ns Cm tunnel Ar src_address dest_address 1810.Op Oo Fl Oc Ns Cm tunneldf 1811.Op Oo Fl Oc Ns Cm tunneldomain Ar rtable 1812.Op Cm tunnelttl Ar ttl 1813.Op Cm txprio Ar prio 1814.Op Oo Fl Oc Ns Cm vnetflowid 1815.Op Oo Fl Oc Ns Cm vnetid Ar network-id 1816.Ek 1817.nr nS 0 1818.Pp 1819.Xr egre 4 , 1820.Xr eoip 4 , 1821.Xr etherip 4 , 1822.Xr gif 4 , 1823.Xr gre 4 , 1824.Xr mgre 4 , 1825.Xr nvgre 4 , 1826and 1827.Xr vxlan 4 1828are all tunnel interfaces. 1829The following options are available: 1830.Bl -tag -width Ds 1831.It Cm keepalive Ar period count 1832Enable 1833.Xr gre 4 1834keepalive with a packet sent every 1835.Ar period 1836seconds. 1837A second timer is run with a timeout of 1838.Ar count 1839* 1840.Ar period . 1841If no keepalive response is received during that time, the link is considered 1842down. 1843The minimal usable 1844.Ar count 1845is 2 since the round-trip time of keepalive packets needs to be accounted for. 1846.It Cm -keepalive 1847Disable the 1848.Xr gre 4 1849keepalive mechanism. 1850.It Cm rxprio Ar prio 1851Configure the source used for the packet priority when decapsulating a packet. 1852The value can be a priority number from 0 to 7, or 1853.Ar packet 1854to use the priority currently set on the packet. 1855If supported by the interface, the value may also be set to 1856.Ar outer 1857to have the priority field copied from the tunnel protocol headers, or 1858.Ar payload 1859to have the priority field copied from the encapsulated protocol headers. 1860.It Cm tunnel Ar src_address dest_address Ns Op : Ns Ar dest_port 1861Set the source and destination tunnel addresses on a tunnel interface. 1862Packets routed to this interface will be encapsulated in 1863IPv4 or IPv6, depending on the source and destination address families. 1864Both addresses must be of the same family. 1865The optional destination port can be specified for interfaces such as 1866.Xr vxlan 4 , 1867which further encapsulate the packets in UDP datagrams. 1868.It Cm -tunnel 1869Remove the source and destination tunnel addresses. 1870.It Cm tunneldf 1871Do not allow fragmentation of encapsulated packets. 1872.It Cm -tunneldf 1873Allow fragmentation of encapsulated packets. 1874.It Cm tunneldomain Ar rtable 1875Use routing table 1876.Ar rtable 1877instead of the default table. 1878The tunnel does not need to terminate in the same routing domain as the 1879interface itself. 1880.Ar rtable 1881can be set to any valid routing table ID; 1882the corresponding routing domain is derived from this table. 1883.It Cm -tunneldomain 1884Use the default routing table and routing domain 0. 1885.It Cm tunnelttl Ar ttl 1886Set the IP or multicast TTL of the tunnel packets. 1887If supported by the tunnel protocol, 1888the value can also be set to 1889.Ar copy 1890to have the TTL copied between the encapsulated protocol headers 1891and the tunnel protocol headers. 1892.It Cm txprio Ar prio 1893Configure the value used for the priority field in the tunnel 1894protocol headers. 1895The value can be a priority number from 0 to 7, or 1896.Ar packet 1897to use the priority currently set on the packet. 1898If supported by the interface, the value can also be set to 1899.Ar payload 1900to have the priority field copied from the encapsulated protocol headers 1901to the tunnel protocol headers. 1902.It Cm vnetflowid 1903Use a portion of the virtual network identifier space for a flow identifier. 1904This allows load balancing of the encapsulated traffic over multiple 1905links. 1906.It Cm -vnetflowid 1907Disable the use of a flow identifier in the virtual network identifier. 1908.It Cm vnetid Ar network-id 1909Set the virtual network identifier. 1910This is a number which is used by tunnel protocols such as 1911.Xr eoip 4 1912and 1913.Xr vxlan 4 1914to identify packets with a virtual network. 1915The accepted size of the number depends on the individual tunnel protocol; 1916it is a 16-bit number for 1917.Xr eoip 4 , 1918and a 24-bit number for 1919.Xr vxlan 4 . 1920If supported by the tunnel protocol, 1921the value can also be set to 1922.Ar any 1923to accept packets with arbitrary network identifiers (for example for 1924multipoint-to-multipoint modes). 1925.It Cm -vnetid 1926Clear the virtual network identifier. 1927.El 1928.Sh UMB 1929.nr nS 1 1930.Bk -words 1931.Nm ifconfig 1932.Ar umb-interface 1933.Op Oo Fl Oc Ns Cm apn Ar apn 1934.Op Cm chgpin Ar oldpin newpin 1935.Op Oo Fl Oc Ns Cm class Ar class,class,... 1936.Op Cm pin Ar pin 1937.Op Cm puk Ar puk newpin 1938.Op Oo Fl Oc Ns Cm roaming 1939.Ek 1940.nr nS 0 1941.Pp 1942The following options are available for a 1943.Xr umb 4 1944interface: 1945.Bl -tag -width Ds 1946.It Cm apn Ar apn 1947Set the Access Point Name (APN) required by the network provider. 1948.It Cm -apn 1949Clear the current APN. 1950.It Cm chgpin Ar oldpin newpin 1951Permanently change the PIN of the SIM card from the current value 1952.Ar oldpin 1953to 1954.Ar newpin . 1955.It Cm class 1956List all available cell classes. 1957.It Cm class Ar class,class,... 1958Set the preferred cell classes. 1959Apart from those listed by 1960.Cm class 1961the following aliases can be used: 1962.Ar 4G , 1963.Ar 3G , 1964and 1965.Ar 2G . 1966.It Cm -class 1967Clear any cell class preferences. 1968.It Cm down 1969Marking the interface as "down" will terminate any existing data connection 1970and deregister with the service provider. 1971.It Cm pin Ar pin 1972Enter the PIN required to unlock the SIM card. 1973Most SIM cards will not be able to establish a network association without 1974providing a PIN. 1975.It Cm puk Ar puk newpin 1976Sets the PIN of the SIM card to 1977.Ar newpin 1978using the PUK 1979.Ar puk 1980to validate the request. 1981.It Cm roaming 1982Enable data roaming. 1983.It Cm -roaming 1984Disable data roaming. 1985.It Cm up 1986As soon as the interface is marked as "up", the 1987.Xr umb 4 1988device will try to establish a data connection with the service provider. 1989.El 1990.Sh VLAN 1991.nr nS 1 1992.Bk -words 1993.Nm ifconfig 1994.Ar vlan-interface 1995.Op Oo Fl Oc Ns Cm parent Ar parent-interface 1996.Op Cm rxprio Ar prio 1997.Op Cm txprio Ar prio 1998.Op Oo Fl Oc Ns Cm vnetid Ar vlan-tag 1999.Ek 2000.nr nS 0 2001.Pp 2002The following options are available for 2003.Xr vlan 4 2004and 2005.Xr svlan 4 2006VLAN interfaces: 2007.Bl -tag -width Ds 2008.It Cm parent Ar parent-interface 2009Associate the VLAN interface with the interface 2010.Ar parent-interface . 2011Packets transmitted on 2012.Xr vlan 4 2013or 2014.Xr svlan 4 2015interfaces will be tagged with 802.1Q or 802.1ad headers respectively 2016and transmitted on the specified parent interface. 2017Packets with 802.1Q or 802.1ad tags received 2018by the parent interface with the specified VLAN tag will be diverted to 2019the associated VLAN interface. 2020Unless a custom Ethernet address is assigned to the VLAN interface, 2021it will inherit a copy of the parent interface's Ethernet address. 2022.It Cm -parent 2023Disassociate from the parent interface. 2024This breaks the link between the VLAN interface and its parent. 2025.It Cm rxprio Ar prio 2026Set the value used for the packet priority field. 2027Values may be from 0 to 7, 2028.Ar packet 2029to maintain the current packet priority, or 2030.Ar outer 2031to use the priority field in the 802.1Q or 802.1ad headers. 2032.It Cm txprio Ar prio 2033Set the value used for the priority field in the 802.1Q or 802.1ad 2034headers. 2035Values may be from 0 to 7, or 2036.Ar packet 2037to use the priority of packets transmitted on the interface. 2038.It Cm vnetid Ar vlan-tag 2039Set the VLAN tag value to 2040.Ar vlan-tag . 2041This value is a 12-bit number which is used in the 802.1Q or 802.1ad 2042headers in packets handled by 2043.Xr vlan 4 2044or 2045.Xr svlan 4 2046interfaces respectively. 2047Valid tag values are from 1 to 4094 inclusive. 2048.It Cm -vnetid 2049Clear the tag value. 2050Packets on a VLAN interface without a tag set will use a value of 20510 in their headers. 2052.El 2053.Sh WIREGUARD 2054.nr nS 1 2055.Bk -words 2056.Nm ifconfig 2057.Ar wg-interface 2058.Op Cm wgkey Ar privatekey 2059.Op Cm wgport Ar port 2060.Op Cm wgrtable Ar rtable 2061.Oo 2062.Oo Fl Oc Ns Cm wgpeer Ar publickey 2063.Op Cm wgpsk Ar presharedkey 2064.Op Fl wgpsk 2065.Op Cm wgpka Ar persistent-keepalive 2066.Op Cm wgendpoint Ar ip port 2067.Op Cm wgaip Ar allowed-ip/prefix 2068.Oc 2069.Op Fl wgpeerall 2070.Ek 2071.nr nS 0 2072.Pp 2073The following options are available for 2074.Xr wg 4 2075interfaces: 2076.Bl -tag -width Ds 2077.It Cm wgkey Ar privatekey 2078Set the local private key of the interface to 2079.Ar privatekey . 2080This is a random 32-byte value, encoded as base64. 2081It may be generated as follows: 2082.Pp 2083.Dl $ openssl rand -base64 32 2084.Pp 2085A valid Curve25519 key is required to have 5 bits set to specific 2086values. 2087This is done by the interface, so it is safe to provide a random 208832-byte base64 string. 2089.Pp 2090Once set, the corresponding public key will be displayed 2091in the interface status; it must be distributed to peers 2092that this interface intends to communicate with. 2093.It Cm wgport Ar port 2094Set the UDP 2095.Ar port 2096that the tunnel operates on. 2097The interface will bind to 2098.Dv INADDR_ANY 2099and 2100.Dv IN6ADDR_ANY_INIT . 2101If no port is configured, one will be chosen automatically. 2102.It Cm wgrtable Ar rtable 2103Use routing table 2104.Ar rtable 2105instead of the default table for the tunnel. 2106The tunnel does not need to terminate in the same routing domain as the 2107interface itself. 2108.Ar rtable 2109can be set to any valid routing table ID; the corresponding routing 2110domain is derived from this table. 2111.It Cm wgpeer Ar publickey 2112Select the peer to perform the subsequent operations on. 2113This creates a peer with the associated 32-byte, base64-encoded 2114.Ar publickey 2115if it does not yet exist. 2116This option can be specified multiple times in a single command. 2117.It Cm -wgpeer Ar publickey 2118Remove the peer with the associated 2119.Ar publickey . 2120.It Cm -wgpeerall 2121Remove all peers from the interface. 2122.El 2123.Pp 2124The following options configure peers for the interface. 2125Each interface can have multiple peers. 2126In order to add a peer, a 2127.Cm wgpeer 2128option must be specified, followed by its configuration options. 2129.Bl -tag -width Ds 2130.It Cm wgpsk Ar presharedkey 2131Set the preshared key for the peer. 2132This is a random 32-byte, base64-encoded string 2133that both ends must agree on. 2134It offers a post-quantum resistance to the Diffie-Hellman exchange. 2135If there is no preshared key, the exact same handshake is performed, 2136however the preshared key is set to all zero. 2137This can be generated in the same way as 2138.Ar privatekey . 2139.It Cm -wgpsk 2140Remove the preshared key from the specified peer. 2141.It Cm wgpka Ar persistent-keepalive 2142Set the interval of additional keepalive packets in seconds. 2143By default this functionality is disabled, equivalent to a value of 0. 2144This is often used to ensure a peer will be accessible when protected by 2145a firewall, as when behind a NAT address. 2146A value of 25 is commonly used. 2147.It Cm wgendpoint Ar ip port 2148Set the IP address and port to send the encapsulated packets to. 2149If the peer changes address, the local interface will update the address 2150after receiving a correctly authenticated packet. 2151The IP address can be either 2152IPv4 or IPv6, and the port is a regular 16-bit UDP port. 2153.It Cm wgaip Ar allowed-ip/prefix 2154Set the allowed IPs for the peer. 2155The allowed IPs indicate the IP addresses a peer is allowed to send 2156from. 2157That is, in order for an incoming packet from a peer to reach the host, 2158the decrypted IP source address must be in the peer's 2159.Ar allowed-ip 2160ranges. 2161.Pp 2162The 2163.Ar allowed-ip 2164list also provides an outgoing routing table for outgoing packets. 2165Overlapping ranges can be configured, with packets being 2166directed to the most specific route. 2167Likewise, packets can only be received for the most specific route. 2168.Pp 2169Both IPv4 and IPv6 addresses are supported. 2170To set multiple allowed IPs, specify the 2171.Cm wgaip 2172option multiple times in the same 2173.Nm 2174invocation. 2175.El 2176.Sh EXAMPLES 2177Assign the 2178address of 192.168.1.10 with a network mask of 2179255.255.255.0 to interface fxp0: 2180.Pp 2181.Dl # ifconfig fxp0 inet 192.168.1.10 netmask 255.255.255.0 2182.Pp 2183Configure the xl0 interface to use 100baseTX, full duplex: 2184.Pp 2185.Dl # ifconfig xl0 media 100baseTX mediaopt full-duplex 2186.Pp 2187Label the em0 interface as an uplink: 2188.Pp 2189.Dl # ifconfig em0 description \&"Uplink to Gigabit Switch 2\&" 2190.Pp 2191Create the gif1 network interface: 2192.Pp 2193.Dl # ifconfig gif1 create 2194.Pp 2195Put the athn0 wireless interface into monitor mode: 2196.Pp 2197.Dl # ifconfig athn0 mediaopt monitor 2198.Sh DIAGNOSTICS 2199Messages indicating the specified interface does not exist, the 2200requested address is unknown, or the user is not privileged and 2201tried to alter an interface's configuration. 2202.Sh SEE ALSO 2203.Xr netstat 1 , 2204.Xr ifmedia 4 , 2205.Xr inet 4 , 2206.Xr intro 4 , 2207.Xr netintro 4 , 2208.Xr route 4 , 2209.Xr hostname.if 5 , 2210.Xr hosts 5 , 2211.Xr rc 8 , 2212.Xr slaacd 8 , 2213.Xr tcpdump 8 2214.Sh HISTORY 2215The 2216.Nm 2217command appeared in 2218.Bx 4.2 . 2219