August 16th, 2005, 12:38
i figured out how to add a route, route add -net

but when i reboot the machine, i lost my route and then i have to get back on to the console and re-add it.

i tried man route and googled for it, which actually led me back here!


August 16th, 2005, 13:37
From the fbsd handbook:

route(8) ("] Persistent Configuration[/url]

The above example is perfect for configuring a static route on a running system. However, one problem is that the routing information will not persist if you reboot your FreeBSD machine. The way to handle the addition of a static route is to put it in your /etc/rc.conf file:

# Add Internal Net 2 as a static route
The static_routes configuration variable is a list of strings separated by a space. Each string references to a route name. In our above example we only have one string in static_routes. This string is internalnet2. We then add a configuration variable called route_internalnet2 where we put all of the configuration parameters we would give to the [url="http://www.FreeBSD.org/cgi/man.cgi?query=route&sektion=8) command. For our example above we would have used the command:

# route add -net so we need "-net".

As said above, we can have more than one string in static_routes. This allows us to create multiple static routes. The following lines shows an example of adding static routes for the and networks on an imaginary router:

static_routes="net1 net2"

August 20th, 2005, 13:47
static_routes="net1 net2"

Well, that's it ... just add these line in your /etc/rc.conf ... of course you'll have to change them to fit your needs :)