Aller au contenu

VRF - Virtual routing and forwarding

  • Déclaration multi rdomain dans /boot/loader.conf
    Le redémarrage est nécessaire pour appliquer les modifications.
net.fibs="2"
  • Création d'une table de routage
1
2
3
setfib -F 1 route add default 10.10.10.254
# OU
setfib 1 route add default 10.10.10.254
  • Visualisation des routes
setfib 1 netstat -rn
  • Attribution d'une interface à un domaine de routage
ifconfig igb0 inet 10.10.10.1 netmask 255.255.255.0 fib 1
  • Attribution de façon permanente via /etc/rc.conf :
1
2
3
4
5
ifconfig_igb0="inet 10.10.10.1 netmask 255.255.255.0 fib 1"
ifconfig_igb0_descr="Interface rdomain 1"

route_default_rdomain1="default 10.10.10.254 -fib 1"
static_routes="default_rdomain1"
  • Exécution d'une commande depuis une table de routage
setfib 1 nc -zv mydomain.com 22
  • Attribution d'une table de routage à un service
1
2
3
4
sysrc squid_fib=1
# OU
# Ajouter manuellement la ligne dans /etc/rc.conf
squid_fib=1
  • Visualisation des processus avec leur table de routage
ps axu -o fib
  • Visualiser des connexions réseaux dans une table de routage
netstat -lan -f inet -F 1