Debian IPv6网络配置

时间:2020-01-09 14:16:13  来源:igfitidea点击:

如何在Debian Linux下配置静态IPv6网络?
您需要将网络配置添加到/etc/network/interfaces文件,如下所示:
a)Ipv6地址

b)Ipv6网关

c)网络掩码

出样例Debian Linux Ipv6配置

  • ipv6地址IP:2607:f0d0:2001:000a:0000:0000:0000:0002/64
  • ipv6网关IP:2607:f0d0:2001:000a:0000:0000:0000:0001
  • 接口名称:eth0
  • IPv6类型:静态

打开/etc/network/interfaces文件,输入:

# vi /etc/network/interfaces

追加配置如下:

#IPV6 static configuration
iface eth0 inet6 static
pre-up modprobe ipv6 
address 2607:f0d0:2001:000a:0000:0000:0000:0002
netmask 64
gateway 2607:f0d0:2001:000a:0000:0000:0000:0001
# END IPV6 configuration

保存并关闭文件。
重新启动网络:

# /etc/init.d/networking restart

验证IPv6网络

打印当前路由:

# ip -6 route show

支持ping Ipv6的网站:

# ping6 www.theitroad.local
# ping6 ipv6.google.com

输出示例:

PING www.theitroad.local(www.theitroad.local) 56 data bytes
64 bytes from www.theitroad.local: icmp_seq=1 ttl=60 time=65.2 ms
64 bytes from www.theitroad.local: icmp_seq=2 ttl=60 time=64.0 ms
64 bytes from www.theitroad.local: icmp_seq=3 ttl=60 time=64.0 ms
64 bytes from www.theitroad.local: icmp_seq=4 ttl=60 time=64.0 ms
64 bytes from www.theitroad.local: icmp_seq=5 ttl=60 time=63.9 ms