网络配置文件 /etc/network/interfaces的典型IPv6配置
# The primary network interface auto eth0 iface eth0 inet static address 15.12.178.81 netmask 255.255.255.0 gateway 15.12.178.1 iface eth0 inet6 static accept_ra 0 address 2a04:ac0d:101:84e:: netmask 64 gateway 2a04:ac0d:0101:0000:0000:0000:0000:0001 post-up /sbin/ip -r route add 2a04:ac0d:0101:0000:0000:0000:0000:0001 dev eth0 post-up /sbin/ip -r route add default via 2a04:ac0d:0101:0000:0000:0000:0000:0001
# OVZ Debian 9 iface venet0 inet6 static address ::2 netmask 128 up ip -6 r a default dev venet0 up ip addr add 210b:5100:60:370f:d3::5cb4/80 dev venet0
参数示意
1、 eth0为网卡 名称
2、 static静态地址
3、address为IP地址
4、netmask掩码
5、gateway网关
6、ip命令增加路由