# Adding a static route in conf.d/net

## GD

Hello,

I want to add the following static routing rule to the routing table:

route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.2.24.190

I was wondering whether there is a way to do it in /etc/conf.d/net

/etc/conf.d/net.example only explains how to add the default route to an interface...

I've tried:

```
routes_eth2=(

       "10.0.0.0 netmask 255.0.0.0 via 10.2.24.190"

)

```

and

```
routes_eth2=(

       "10.0.0.0/8 via 10.2.24.190"

)

```

but it doesn't work... Any ideas?

Thanks in advance,

George

----------

## nomorecoolnames

Hello GD.  There is probably another, more precise way to do this but you could add  *Quote:*   

> route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.2.24.190 

  to /etc/conf.d/local.start

----------

## nectarboi

Hello. You could also use the 4 functions described in the advance configuration section of the example file.

```

postup() {

 route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.2.24.190 ${IFACE}

 return 0

}

```

----------

## UberLord

Should work with baselayout-1.12, maybe not with 1.11

----------

## codine

Let me know if this is wrong, but you should just add a "-net" before that command, such as:

```
routes_eth2=( 

       "-net 10.0.0.0 netmask 255.0.0.0 via 10.2.24.190" 

) 
```

or

```
routes_eth2=( 

       "-net 10.0.0.0/8 via 10.2.24.190" 

)
```

----------

