Add route to 172.30.x.x via 192.168.10.100 on freebsd
To add a route to 172.30.x.x via 192.168.10.100 on FreeBSD, you can use the route command. Here is how:
sh
sudo route add 172.30.0.0/16 192.168.10.100
This adds a route to the 172.30.0.0/16 subnet via the gateway 192.168.10.100.
If you want this route to persist after reboots, you can add it to the /etc/rc.conf file or the /etc/rc.conf.d/routing file:
Edit
/etc/rc.confor/etc/rc.conf.d/routing:- You can use an editor like
viornano. For example:sh nano /etc/rc.conf.d/routing
- You can use an editor like
Add the route:
- Add the following line:
sh static_routes="my_route" route_my_route="172.30.0.0/16 192.168.10.100"
- Add the following line:
Save and exit:
Activate the route immediately:
- Run the command:
sh sudo service routing start
- Run the command:
This ensures that the route is added every time the system boots.