# /etc/conf.d/net, routes, postup/postdown handlers right way

## modnaruved

Hi!

I saw in net.examples.bz2 note about some disadvantages in postup/postdown handlers:

 *Quote:*   

> 
> 
> ...
> 
> # 
> ...

 

I need just add route something like:

```

route add -host 192.168.1.100 tap0

```

How can I add in /etc/conf.d/net that route correctly by syntax like this (as in example):

```

# Here's how to do routing if you need it

# We add an IPv4 default route, IPv4 subnet route and an IPv6 unicast route

#routes_eth0="default via 192.168.0.1

#10.0.0.0/8 via 192.168.0.1

#::/0"

```

?

I cant find any comprehensive guide about syntax and rules how to write simple rule like route add -host $IP $I in /etc/conf.d/net

As tempo solution this works for me in /etc/conf.d/net :

```

$ii=wlp3s0

$idest=tap0

postup()

{

        if [[ $IFACE == $ii ]] ; then

           route add -host 192.168.1.100 $idest

        fi

        return

}

postdown()

{

        if [[ $IFACE == $ii ]] ; then

           route del -host 192.168.1.100 $idest

        fi

        return

}

```

Thanks for any solutions

----------

## massimo

Does it work if you add the following to the config (routes_eth0): 

```
192.168.1.100/32 dev tap0
```

----------

