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