V
V
Vincent12021-04-06 15:36:28
linux
Vincent1, 2021-04-06 15:36:28

How to add multiple ipv4-to-ipv6 tunnels?

Adding the first tunnel

ip tunnel add ipv6tunnel mode sit remote 209.51.161.17 local 45.139.184.125 ttl 255
ip link set ipv6tunnel up
ip addr add 2001:470:1f06:2f8::2/64 dev ipv6tunnel
ip route add ::/0 dev ipv6tunnel

Problem when I add the second one
ip tunnel add ipv6tunnel-2 mode sit remote 184.105.250.77 local 185.230.132.140 ttl 255
ip link set ipv6tunnel-2 up
ip addr add 2001:470:39:1da::2/64 dev ipv6tunnel-2

And when I add a route, I get an error
ip route add ::/0 dev ipv6tunnel-2
RTNETLINK answers: File exists
How to add several ipv4-to-ipv6 tunnels correctly?

route -nA inet6
[email protected]:~# route -nA inet6
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
::1/128                        ::                         U    256 1     0 lo
2001:470:39:1da::/64           ::                         Un   256 1     0 ipv6tunnel-2
2001:470:1f06:2f8::/64         ::                         Un   256 1     0 ipv6tunnel
fe80::/64                      ::                         U    256 1     0 eth0
fe80::/64                      ::                         Un   256 1     0 ipv6tunnel
fe80::/64                      ::                         Un   256 1     0 ipv6tunnel-2
::/0                           ::                         U    1024 2    75 ipv6tunnel
::1/128                        ::                         Un   0   3    11 lo
2001:470:39:1da::2/128         ::                         Un   0   2     0 ipv6tunnel-2
2001:470:1f06:2f8::2/128       ::                         Un   0   3    75 ipv6tunnel
fe80::2d8b:b87d/128            ::                         Un   0   2     0 ipv6tunnel
fe80::b9e6:848c/128            ::                         Un   0   2     0 ipv6tunnel-2
fe80::5054:ff:fe51:e932/128    ::                         Un   0   2     0 eth0
ff00::/8                       ::                         U    256 2     8 eth0
ff00::/8                       ::                         U    256 1     0 ipv6tunnel
ff00::/8                       ::                         U    256 1     0 ipv6tunnel-2
::/0                           ::                         !n   -1  1     1 lo

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
none7, 2021-04-06
@Vincent1

He most likely swears at the existence of a default route with the same metric as you are trying to add. Routes added via ip route do not inherit interface metrics.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question