Similar as on FreeBSD and Linux, you can add/remove static network routes through the command line with the route command. The syntax somewhat differs from Linux, though.
To add a route (e.g. subnet 192.168.3.0/24 to gateway 192.168.1.254):
sudo route -n add -net 192.168.3.0/24 192.168.1.254
To remove a route:
sudo route -n delete -net 192.168.3.0/24
To show the current route table, you can use netstat:
netstat -nr
« ‹ | November 2024 | › » | ||||
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |