# Multiple ip addresses with different routes

## Salem

Hello,

i want to configure two ip addresses with different default gateways.

Not sure how i can do this in the net-conf.

I need:

10.0.0.2 netmask 255.255.255.0

default to 10.0.0.1

10.0.0.3 netmask 255.255.255.0

default to 10.0.0.100

But how can i configure this in in /etc/conf.d/net?

```
config_eth0="10.0.0.2 netmask 255.255.255.0"

routes_eth0="default via 10.0.0.1"

```

Thanks

----------

## Hu

Could you explain why you want to do this?  It is rare to have two private range IP addresses on the same subnet with separate routing rules, so this configuration often indicates that a simpler solution exists.

----------

## Schnulli

Hi,

have a look at this:

http://homepage.smc.edu/morgan_david/vpn/assignments/ifroute-assgt.htm

Should help you  :Wink: 

greetz

----------

## chiefbag

This should do the trick, note BaseLayout2 notation.

```
config_eth0="10.0.0.2/24      

             10.0.0.3/24"       

routes_eth0="default via 10.0.0.1

             10.0.0.3 via 10.0.0.100"
```

----------

## armxx048

 *Schnulli wrote:*   

> Hi,
> 
> have a look at this:
> 
> http://homepage.smc.edu/morgan_david/vpn/assignments/ifroute-assgt.htm
> ...

 

Thanks bro that was indeed an indepth guide on how to setup multiple ip addresses with different default gateways

----------

