• Linux
  • FreeBSD
  • Networking
  • Python
  • AWS
  • WebDev
  • About Us

How to add a static route in FreeBSD

Written by
FreeBSD Leave a Comment

To add a static route via a specific interface: where re1 is my wan interface and destinationip is your remote IP . You can do an ‘ifconfig’ to see your network interfaces

route add -host destinationip -interface re1

To delete the host:

route delete -host destinationip -interface re1

To add a default route to allow all traffic: where 192.168.1.1 is the default gateway

route add -net 0.0.0.0/0 192.168.1.1
route add default 192.168.1.1

To show all routes via a specific interface:

route show re1

© Copyright 2020.TechieNix. All Rights Reserved.