我尝试使用以下命令将整个IPv6(/ 64)块添加到接口
ip route add local 2001:41d0:2:ad64::/64 dev lo
像描述在这里我的Debian服务器上,但我似乎失去了一些东西。
例如2001:41d0:2:ad64::fe
,如果我在本地ping 一切正常,但如果从远程计算机尝试,则无法正常工作。然后,我尝试在eth0上添加路由:
ip route add local 2001::41d0:2:ad64::/64 dev eth0
现在,我什至无法在本地ping任何示例地址!
我有点迷茫,因为我似乎丢失了一些东西,但是我在这里找不到答案。
简而言之:我想2001:41d0:2:ad64::/64
绑定到eth0,以便可以从我的机器上的Internet访问此块包含的每个IP。
我希望有人可以指出正确的方法。提前致谢。
ISP提供的指南确实要求我将每个IPv6明确添加到接口。我希望它是隐含的。
具有明确IP地址绑定的工作配置
/ etc / network / interfaces:
auto eth0
iface eth0 inet static
address my.ip.v4
netmask 255.255.255.0
network my.network.address.ip
broadcast my.broadcast.address.ip
gateway my.gateway.ip
iface eth0 inet6 static
address 2001:41d0:2:ad64::fe
netmask 64
gateway 2001:41d0:2:adff:ff:ff:ff:ff
up ip addr add 2001:41d0:2:ad64::1/64 dev eth0
down ip addr del 2001:41d0:2:ad64::1/64 dev eth0
up ip addr add 2001:41d0:2:ad64::2/64 dev eth0
down ip addr del 2001:41d0:2:ad64::2/64 dev eth0
up ip addr add 2001:41d0:2:ad64::3/64 dev eth0
down ip addr del 2001:41d0:2:ad64::3/64 dev eth0
up ip addr add 2001:41d0:2:ad64::4/64 dev eth0
down ip addr del 2001:41d0:2:ad64::4/64 dev eth0
up ip addr add 2001:41d0:2:ad64::5/64 dev eth0
down ip addr del 2001:41d0:2:ad64::5/64 dev eth0
up ip addr add 2001:41d0:2:ad64::6/64 dev eth0
down ip addr del 2001:41d0:2:ad64::6/64 dev eth0
up ip addr add 2001:41d0:2:ad64::7/64 dev eth0
down ip addr del 2001:41d0:2:ad64::7/64 dev eth0
up ip addr add 2001:41d0:2:ad64::8/64 dev eth0
down ip addr del 2001:41d0:2:ad64::8/64 dev eth0
up ip addr add 2001:41d0:2:ad64::9/64 dev eth0
down ip addr del 2001:41d0:2:ad64::9/64 dev eth0
up ip addr add 2001:41d0:2:ad64::a/64 dev eth0
down ip addr del 2001:41d0:2:ad64::a/64 dev eth0
解决方案尝试#1
我尝试按照@kasperd的建议重新启用本地路由。
我的/ etc / network / interfaces的内容
auto lo
iface lo inet loopback
post-up ip route add local 2001:41d0:2:ad64::/64 dev lo
pre-down ip route del local 2001:41d0:2:ad64::/64 dev lo
auto eth0
iface eth0 inet static
# <snip of ipv4 config>
iface eth0 inet6 static
address 2001:41d0:2:ad64::fe
netmask 64
gateway 2001:41d0:2:adff:ff:ff:ff:ff
本地路由表:
# ip -6 route show table local
local ::1 dev lo proto none metric 0
local 2001:41d0:2:ad64::fe dev lo proto none metric 0
local 2001:41d0:2:ad64::/64 dev lo metric 1024
local fe80::225:90ff:fe06:6bbe dev lo proto none metric 0
ff00::/8 dev eth0 metric 256
traceroute
(我的本地家用PC)的输出:
1 <1 ms <1 ms <1 ms fritz.box [xxx]
2 20 ms 21 ms 24 ms 2002:c058:6301::1
3 21 ms 22 ms 24 ms 10gigabitethernet6.switch2.fra1.he.net [2001:470
:0:150::1]
4 44 ms 31 ms 40 ms 100ge3-1.core1.ams1.he.net [2001:470:0:2d4::1]
5 * * * Zeitüberschreitung der Anforderung.
6 * * 35 ms ams-5-6k.nl.eu [2001:41d0::8d1]
7 37 ms 39 ms 36 ms rbx-g2-a9.fr.eu [2001:41d0::ab1]
8 37 ms 70 ms 36 ms chi-3-4m.il.us [2001:41d0::176]
9 Zielhost nicht erreichbar.
Ablaufverfolgung beendet.
traceroute6
在服务器上:
traceroute to 2001:41d0:2:ad64::23 (2001:41d0:2:ad64::23), 30 hops max, 80 byte packets
1 2001:41d0:2:ad64::a (2001:41d0:2:ad64::a) 0.028 ms 0.009 ms 0.008 ms
ping6
在服务器上:
PING 2001:41d0:2:ad64::23(2001:41d0:2:ad64::23) 56 data bytes
64 bytes from 2001:41d0:2:ad64::23: icmp_seq=1 ttl=64 time=0.029 ms
64 bytes from 2001:41d0:2:ad64::23: icmp_seq=2 ttl=64 time=0.057 ms
^C
--- 2001:41d0:2:ad64:23 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.029/0.043/0.057/0.014 ms
tcpdump
输出(在远程服务器上执行ping和tracerouting时):
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
tracert
到网关:
Routenverfolgung zu vss-3-6k.fr.eu [2001:41d0:2:adff:ff:ff:ff:ff] über maximal 3
0 Abschnitte:
1 <1 ms <1 ms <1 ms fritz.box [2002:5476:1b4c:0:c225:6ff:fe40:b2b0]
2 23 ms 22 ms 26 ms 2002:c058:6301::1
3 24 ms 40 ms 23 ms 10gigabitethernet6.switch2.fra1.he.net [2001:470
:0:150::1]
4 28 ms 37 ms 39 ms 100ge3-1.core1.ams1.he.net [2001:470:0:2d4::1]
5 * * * Zeitüberschreitung der Anforderung.
6 38 ms 33 ms * ams-5-6k.nl.eu [2001:41d0::8d1]
7 36 ms 39 ms 38 ms rbx-g2-a9.fr.eu [2001:41d0::ab1]
8 36 ms 35 ms 35 ms vss-3-6k.fr.eu [2001:41d0:2:adff:ff:ff:ff:ff]
Ablaufverfolgung beendet.
ping
到网关:
Ping wird ausgeführt für 2001:41d0:2:adff:ff:ff:ff:ff mit 32 Bytes Daten:
Antwort von 2001:41d0:2:adff:ff:ff:ff:ff: Zeit=36ms
Antwort von 2001:41d0:2:adff:ff:ff:ff:ff: Zeit=34ms
Antwort von 2001:41d0:2:adff:ff:ff:ff:ff: Zeit=38ms
Antwort von 2001:41d0:2:adff:ff:ff:ff:ff: Zeit=57ms
Ping-Statistik für 2001:41d0:2:adff:ff:ff:ff:ff:
Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0
(0% Verlust),
Ca. Zeitangaben in Millisek.:
Minimum = 34ms, Maximum = 57ms, Mittelwert = 41ms
因此它仍然只在本地(服务器)工作,而不是从远程(我的电脑)工作。
ip route
命令在IPv6地址中有错字。
2001:41d0:2:adff:ff:ff:ff:ff
之后它将超时。