# Setting both an ipv4 and ipv6 default route

## Darknight

Previously I was able to specify both very cleanly with "default via..." lines but now with openrc/baselayout 2... no more.

```
 * Bringing up interface eth0

 *   aa.bb.cc.dd/24 ... [ ok ]

 *   aa:bb:cc:dd::ee/64 ... [ ok ]

 *   Adding routes

 *     default via aa.bb.cc.df default via fe80::222:56ff:feba:bfbf dev eth0 ... 

Error: either "to" is a duplicate or "default" is a garbage [ !! ]

 *   Waiting for IPv6 addresses ... [ ok ]
```

Thus only the ipv4 route is set. For the time being I have added manually the routes but it can't be a solution.

My /etc/conf.d/net:

```
modules="iproute2"

config_eth0="aa.bb.cc.dd/24 aa:bb:cc:dd::ee/64"

routes_eth0="default via aa.bb.cc.de default via fe80::222:56ff:feba:bfbf dev eth0"
```

Any help is greatly appreciated.

----------

## Yuu

Hi Darknight,

Maybe you should add some 'carriage return' to your configuration, and remove the dupplicate 'default via'.

Here is my setup, maybe it could help :

```
config_eth0="10.11.12.13 netmask 255.255.255.0

2001:0123:0123:0123::1/64"

routes_eth0="default gw 10.11.12.254

2001:0123:0123:01ff:ff:ff:ff:ff/128 dev eth0

default via 2001:0123:0123:01ff:ff:ff:ff:ff"
```

```

ifconfig eth0

eth0      Lien encap:Ethernet  HWaddr 01:02:03:04:05:06  

          inet adr:10.11.12.13  Bcast:10.11.12.255  Masque:255.255.255.0

          adr inet6: fe80::21xx:c0xx:xxxx:6854/64 Scope:Lien

          adr inet6: 2001:0123:0123:0123::1/64 Scope:Global

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:115970059 errors:0 dropped:0 overruns:0 frame:0

          TX packets:167354698 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 lg file transmission:1000 

          RX bytes:57116512674 (53.1 GiB)  TX bytes:170791028430 (159.0 GiB)

          Interruption:19 Adresse de base:0x2000
```

----------

## Darknight

In the end this worked.

```
modules="iproute2"

config_eth0="aa.bb.cc.dd/24

        aa:bb:cc:dd::ee/64"

routes_eth0="default gw aa.bb.cc.de

        default via fe80::222:56ff:feba:bfbf dev eth0"
```

Quirky...

Thank you.

----------

