Adding static routes in FreeBSD

Adding routes is easy but doesn’t survive reboots. In order to make a route static or persistent we add an entry to the /etc/rc.conf file

This
route add 192.168.1.0/24 192.168.3.1

becomes this in /etc/rc.conf
static_routes=”net1″
net1=”-net 192.1681.0/24 192.168.3.1

or if you have multiple routes they are space delimited like this
static_routes=”net1 net2″
route_net1=”-net  192.1681.0/24 192.168.3.1″
route_net2=”-net  192.1682.0/24 192.168.3.1″