Ubuntu IPv6 路由在多个接口上不起作用

Ubuntu IPv6 路由在多个接口上不起作用

我使用多个路由器,但只有默认接口具有 IPv6 连接。我可以通过命令使多个接口在 IPv4 上工作,如本指南所示:https://lartc.org/howto/lartc.rpdb.html

ip route add default via gw dev enx582c80139263 table tablename

但此命令不适用于 IPv6。

这是我的是否配置

enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.7  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 2001:ee0:4714:eea0:74f5:aa75:6d66:e42c  prefixlen 64  scopeid 0x0<global>
        inet6 2001:ee0:4714:eea0:547d:f6d1:166c:5d8  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::9334:be68:d859:2981  prefixlen 64  scopeid 0x20<link>
        ether d8:cb:8a:7c:29:b8  txqueuelen 1000  (Ethernet)
        RX packets 4255791  bytes 5960314953 (5.9 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1101690  bytes 120961050 (120.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enxfcde56ff0106: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.16.116  netmask 255.255.255.0  broadcast 192.168.16.255
        inet6 2402:9d80:22a:41b5:a0e8:11d0:e3d6:b78  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::c7a6:1d27:99e5:eea5  prefixlen 64  scopeid 0x20<link>
        inet6 2402:9d80:22a:41b5:3b15:f3e8:b095:681  prefixlen 64  scopeid 0x0<global>
        inet6 2402:9d80:22a:41b5:1217:d32b:b08a:91a0  prefixlen 64  scopeid 0x0<global>
        ether fc:de:56:ff:01:06  txqueuelen 1000  (Ethernet)
        RX packets 8822  bytes 2709066 (2.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9982  bytes 1915754 (1.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 13733  bytes 1816321 (1.8 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13733  bytes 1816321 (1.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

`

我尝试这个命令:

echo "301 mytable1" >> /etc/iproute2/rt_tables 
ip -6 rule add from 2402:9d80:22a:41b5::/64 table mytable1 
ip -6 route add default via 2402:9d80:22a:41b5::1 dev enxfcde56ff0106 table mytable1 

但尝试时curl -6 --verbose --url "http://google.com" --interface "enxfcde56ff0106" 它返回:

Trying 2404:6800:4005:80e::200e:80...
* TCP_NODELAY set
* connect to 2404:6800:4005:80e::200e port 80 failed: Connection timed out
* Failed to connect to google.com port 80: Connection timed out
* Closing connection 0
curl: (28) Failed to connect to google.com port 80: Connection timed out

邻居

fe80::1 dev enp3s0 lladdr 98:f4:28:e1:d4:48 router REACHABLE
2402:9d80:22a:41b5::1 dev enxfcde56ff0106  FAILED
fe80::f4d9:c4ff:fe63:c0c7 dev enxfcde56ff0106 lladdr fc:dd:55:7b:85:1d router STALE

ip -6 路由

::1 dev lo proto kernel metric 256 pref medium
2001:ee0:4714:eea0::/64 dev enp3s0 proto ra metric 103 pref medium
2402:9d80:22a:41b5::/64 dev enxfcde56ff0106 proto ra metric 101 pref medium
fe80::/64 dev enx00a0c6000000 proto kernel metric 100 pref medium
fe80::/64 dev enxfcde56ff0106 proto kernel metric 101 pref medium
fe80::/64 dev enp3s0 proto kernel metric 103 pref medium
fe80::/64 dev eth2 proto kernel metric 256 pref medium
default via 2402:9d80:22a:41b5::1 dev enxfcde56ff0106 metric 1024 pref medium
default via fe80::1 dev enp3s0 proto ra metric 20103 pref medium

我对 IPv6 不太熟悉,所以这可能是一个愚蠢的问题。真的很抱歉。

相关内容