数码资讯
在Ubuntu上配置静态IPv6
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
我正在尝试在专用的Ubuntu服务器上配置IPv6.我的提供商给了我一个“/ 64”(无论是什么 – 我仍然感到困惑)的IPv6地址.
但是,当我尝试使用它们时,我无法ping任何东西.我该怎么办? ????
# ping6 ipv6.google.com
PING ipv6.google.com(vx-in-x63.1e100.net) 56 data bytes
From fe80::219:d1ff:fefb:42d8 icmp_seq=1 Destination unreachable: Address unreachable
From fe80::219:d1ff:fefb:42d8 icmp_seq=2 Destination unreachable: Address unreachable
From fe80::219:d1ff:fefb:42d8 icmp_seq=3 Destination unreachable: Address unreachable
--- ipv6.google.com ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2014ms
# tracepath6 ipv6.google.com
1?: [LOCALHOST] 0.025ms pmtu 1500
1: fe80::219:d1ff:fefb:42d8%eth0 2000.022ms !H
Resume: pmtu 1500
# cat /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 64.***.***.***
netmask 255.255.255.248
gateway 64.***.***.***
iface eth0 inet6 static
pre-up modprobe ipv6
address 2607:F878:1:***::1
netmask 64
gateway 2607:F878:1:***(same as address)::1
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:19:d1:fb:42:d8
inet addr:64.***.***.*** Bcast:64.***.***.*** Mask:255.255.255.248
inet6 addr: fe80::219:d1ff:fefb:42d8/64 Scope:Link
inet6 addr: 2607:f878:1:***::1/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:52451 errors:0 dropped:0 overruns:0 frame:0
TX packets:39729 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6817761 (6.8 MB) TX bytes:6153835 (6.1 MB)
Interrupt:41 Base address:0xc000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:166 errors:0 dropped:0 overruns:0 frame:0
TX packets:166 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:31714 (31.7 KB) TX bytes:31714 (31.7 KB)
默认网关在IPv6上的工作方式略有不同.
我建议你做的是启动tcpdump并观察路由器广告(你可能想要分析WireShark中的捕获 – 更容易).这就是您的IPv6主机如何知道如何上网.还要注意Neighbor Solicitation,因为这是ARP的替代品.
如果您看到这些请求进入但未退出,则内部防火墙会阻止IPv6流量.如果你看到他们出去(请求),但没有回来,那么你需要确保你的前缀长度是正确的(这是/ 64部分.虽然我已经看到很多/ 64s被传递出去,实际上是a / 48).
重要的大事
ICMP对IPv6功能至关重要.在IPv4中,它可以在没有巨大影响的情况下被阻止,但在IPv6中,整个网络依赖于ICMP来实现其所有功能.不要阻止它.
在参照
My provider gave me a “/64” (whatever
that is – I’m still confused) of IPv6
addresses
这是你的前缀长度,以前称为Subnet Mask,用于CIDR.数字越小,你拥有的IP地址就越多.对于IPv6,/ 64和/ 48非常常见,应该为您提供比您一生中所需的IP地址更多的IP地址.
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。