# [SOLVED] Cannot set IPv6 default route when setup

## OstCollector

After re-install the system, I met the problem the same as https://forums.gentoo.org/viewtopic-p-6532843.html

here is my configuration and tracepath6 result

```

# /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /usr/share/doc/openrc/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

dns_domain_lo="********.name"

config_eth0="206.***.***.141/24

        2607:****:****:c21::****:c410/64"

routes_eth0="default via 206.***.***.1

        default via 2607:****:****:c21::1"

dns_servers="8.8.8.8

        8.8.4.4"

```

```

# /var/log/rc.log

 * Bringing up interface eth0

 *   206.***.***.141/24 ...

 [ ok ]

 *   2607:****:****:c21::****:c410/64 ...

 [ ok ]

 *   Adding routes

 *     default via 206.****.****.1 ...

 [ ok ]

 *     default via 2607:****:****:c21::1 ...

2607:****:****:c21::1: Unknown host

 [ !! ]

```

```

tracepath6 -n 2607:****:****:c21::1

 1?: [LOCALHOST]                        0.000ms pmtu 1500

 1:  2607:****:****:c21::1                                  0.000ms reached

 1:  2607:****:****:c21::1                                  0.000ms reached

     Resume: pmtu 1500 hops 1 back 64

```

It seems I can set the default route manually:

```

# current ipv6 routing table

admin@www ~ $ route -6

Kernel IPv6 routing table

Destination                    Next Hop                   Flag Met Ref Use If

::1/128                        ::                         Un   0   1     8 lo

2607:****:****:c21::****:c410/128 ::                         Un   0   1     0 lo

2607:****:****:c21::/64         ::                         U    256 0     0 eth0

fe80::216:3cff:fe69:1eb/128    ::                         Un   0   1     0 lo

fe80::/64                      ::                         U    256 0     0 eth0

ff00::/8                       ::                         U    256 0     0 eth0

::/0                           ::                         !n   -1  1    13 lo

# manually set IPv6 route

admin@www ~ $ sudo route -A inet6 add ::/0 gw 2607:****:****:c21::1

# new IPv6 routing table

admin@www ~ $ route -6

Kernel IPv6 routing table

Destination                    Next Hop                   Flag Met Ref Use If

::1/128                        ::                         Un   0   1     8 lo

2607:****:****:c21::****:c410/128 ::                         Un   0   1     0 lo

2607:****:****:c21::/64         ::                         U    256 0     1 eth0

fe80::216:3cff:fe69:1eb/128    ::                         Un   0   1     0 lo

fe80::/64                      ::                         U    256 0     0 eth0

ff00::/8                       ::                         U    256 0     0 eth0

::/0                           2607:****:****:c21::1       UG   1   0     0 eth0

::/0                           ::                         !n   -1  1    13 lo

# test

admin@www ~ $ sudo tracepath6 -n he.net

 1?: [LOCALHOST]                        0.000ms pmtu 1500

 1:  2607:****:****:c21::1                                  2.999ms

 1:  2607:****:****:c21::1                                  0.000ms

 2:  2607:****:****:c20::1                                  1.999ms

 3:  2607:fcd0::1d                                         0.999ms

 4:  2001:504:13::1a                                       3.998ms

 5:  2001:470:0:72::1                                      0.999ms

 6:  2001:470:0:2f::1                                      8.995ms asymm  7

 7:  2001:470:0:76::2                                      9.994ms reached

     Resume: pmtu 1500 hops 7 back 57

```

Now I want to set the gateway when setup, rather than manually.

I will provide more information if you require.Last edited by OstCollector on Thu Jan 03, 2013 3:14 am; edited 1 time in total

----------

## floppymaster

Firstly, I recommend installing sys-apps/iproute2 and using the "ip route" command. The old "route" command uses a deprecated interface.

You should be able to configure a default route for IPv6 by specifying ::/0 as the network. For example:

```
routes_eth0="default via 206.***.***.1

   ::/0 via 2607:****:****:c21::1"
```

----------

## OstCollector

 *floppymaster wrote:*   

> Firstly, I recommend installing sys-apps/iproute2 and using the "ip route" command. The old "route" command uses a deprecated interface.
> 
> You should be able to configure a default route for IPv6 by specifying ::/0 as the network. For example:
> 
> ```
> ...

 

Thank you very much for your reply. It works fine now after I installed iproute2, even without specifying ::/0.

 :Very Happy: 

----------

