Static default gateway on FreeBSD 8.0

0

on FreeBSD i know i can use the route command to add a default gateway like this: route add default 192.168.1.254

but this does not save on a reboot. How can i get it to save?

The BSD Guy

Posted 2009-12-23T21:09:06.593

Reputation: 65

Answers

2

To have your custom default gateway saved across reboots, you'll want to edit /etc/rc.conf. There is a directive in there called defaultrouter which is set to NO by default. The line looks like this:

defaultrouter="NO"

open /etc/rc.conf in your editor of choice, find this line, and change NO to the IP address of the gateway so it looks like this:

defaultrouter="192.168.1.254"

this will be persistent across reboots.

John T

Posted 2009-12-23T21:09:06.593

Reputation: 149 037