# Static routes best practice

## ElGuido

Hi there,

I was wondering if people could help shed some light about what is the current best practice for defining static routes on Gentoo which are persistent?

As far as I can see, there are a few candidates as to where they could be defined:

/etc/conf.d/net

/etc/conf.d/local.start

/etc/conf.d/staticroutes

/etc/local.d/baselayout.start

I realize that choice 2 & 4 are the same thing but on different baselayouts.

Also gentoo wiki, suggests the using net.

But the static routes file, by name suggests it would be best...

Anyway, whilst they all would work, I was wondering if one was more sane than another?

Another observation was at least with options in net, the syntax is less involved that sticking an "/sbin/ip blah blah blah" in which is what we seem to do here with other files.

K Rgds,

G

----------

## cach0rr0

doing it within /etc/conf.d/staticroute (and the /etc/init.d/staticroute that uses it )would be the "openrc way" of doing it

ergo that's the direction I'd lean, since it's more likely to be accounted for by other folks maintaining packages moving forward

----------

## ElGuido

Ah brilliant, thanks cach0rr0

----------

## Hu

 *cach0rr0 wrote:*   

> doing it within /etc/conf.d/staticroute (and the /etc/init.d/staticroute that uses it )would be the "openrc way" of doing it

 I would agree, except that on recent stable openrc, you get a warning if you use this script:

```
start()

{

        ewarn

        ewarn "The $RC_SVCNAME script is deprecated and will be"

        ewarn "removed in the future."

        ewarn "Please use the net.* scripts to manage your network interfaces."

        ewarn

        do_routes "Adding" "add"

}
```

----------

## cach0rr0

lovely. so I'm already outdated. 

im still on a bit older openrc release on my systems.

----------

## ElGuido

Ah thank you Hu. Duly noted.

K Rgds,

G

----------

