Prepare fibs:
```
# sysctl net.fibs=3
# sysctl net | grep fibs
net.fibs: 3
net.add_addr_allfibs: 0
```
1. Verify that SIOCSTUNFIB and SIOCGTUNFIB work
```
# setfib 1 ifconfig vxlan0 create
# ifconfig vxlan0 | grep tunnelfib
tunnelfib: 1
# ifconfig vxlan0 tunnelfib 2
# ifconfig vxlan0 | grep tunnelfib
tunnelfib: 2
# ifconfig vxlan0 destroy
```
2. Verify packets are encapsulated and forwarded as intended
```
# ifconfig epair0 create
epair0a
# ifconfig epair0a inet 192.168.100.1/24 fib 1
# ifconfig epair0b inet 192.168.100.2/24 fib 2
# ifconfig vxlan0 create vxlanid 108 vxlanlocal 192.168.100.1 vxlanremote 192.168.100.2 tunnelfib 1
# ifconfig vxlan0 inet 192.0.2.2/24
# ifconfig vxlan0
vxlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1450
options=80020<JUMBO_MTU,LINKSTATE>
ether 58:9c:fc:10:ff:bb
inet 192.0.2.2 netmask 0xffffff00 broadcast 192.0.2.255
groups: vxlan
vxlan vni 108 local 192.168.100.1:4789 remote 192.168.100.2:4789
tunnelfib: 1
media: Ethernet autoselect (autoselect <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# netstat -rnf inet
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 192.168.117.2 UGS em0
127.0.0.1 link#2 UH lo0
192.0.2.0/24 link#3 U vxlan0
192.0.2.2 link#3 UHS lo0
192.168.117.0/24 link#1 U em0
192.168.117.143 link#1 UHS lo0
# netstat -rnf inet -F1
Routing tables (fib: 1)
Internet:
Destination Gateway Flags Netif Expire
192.168.100.0/24 link#4 U epair0a
192.168.100.1 link#4 UHS lo0
# netstat -rnf inet -F 2
Routing tables (fib: 2)
Internet:
Destination Gateway Flags Netif Expire
192.168.100.0/24 link#5 U epair0b
192.168.100.2 link#5 UHS lo0
# ping -c1 192.0.2.3 ;; tcpdump listen on epair0b before pinging
# tcpdump -ni epair0b 'udp port 4789'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on epair0b, link-type EN10MB (Ethernet), capture size 262144 bytes
23:53:12.452700 IP 192.168.100.1.29534 > 192.168.100.2.4789: VXLAN, flags [I] (0x08), vni 108
ARP, Request who-has 192.0.2.3 tell 192.0.2.2, length 28
```