Hello,
I have two NICs one for LAN (172.16.2.0/24, igb0) and other for DMZ (192.168.20.0/24, igb1). I wanted to set up separate routes for these using FIB.
My config is
rc.conf
Routing tables on the first FIB looks like this
The second routing table is empty
Now if i try to add a default route in the second routing table it fails
How can I populate the routing table for the second FIB?
I have two NICs one for LAN (172.16.2.0/24, igb0) and other for DMZ (192.168.20.0/24, igb1). I wanted to set up separate routes for these using FIB.
My config is
Code:
#cat /boot/loader.conf
net.fibs=2
net.add_addr_allfibs=0
rc.conf
Code:
#cat /etc/rc.conf
ifconfig_igb0="DHCP"
ifconfig_igb1="DHCP"
Routing tables on the first FIB looks like this
Code:
#setfib 0 netstat -rn
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 192.168.20.1 UGS igb1
127.0.0.1 link#3 UH lo0
172.16.2.0/24 link#1 U igb0
172.16.2.5 link#1 UHS lo0
192.168.20.0/24 link#2 U igb1
192.168.20.135 link#2 UHS lo0
The second routing table is empty
Code:
#setfib 1 netstat -rn
Routing tables (fib: 1)
Now if i try to add a default route in the second routing table it fails
Code:
#setfib 1 route add -net 192.168.20.0/24
route: writing to routing socket: Invalid argument
add net 192.168.20.0 fib 1: Invalid argument
#setfib 1 route add default 192.168.20.1
route: writing to routing socket: Network is unreachable
add net default: gateway 192.168.20.1 fib 1: Network is unreachable
How can I populate the routing table for the second FIB?