一、打开ipv6

modprobe ipv6
echo "ipv6" >> /etc/modules

二、配置ipv6

vi /etc/network/interfaces

在最下面一行添加

iface eth0 inet6 auto

让主机自动获取ip

若无法自动获取则手动配置ipv6

将代码改成

iface eth0 inet6 static
        address 2001:470:ffff:ff::2
        netmask 64
        gateway 2001:470:ffff:ff::1
        pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra

address是ip地址,gateway是网关地址,请根据情况修改

重启网络生效

service networking restart

标签: none

添加新评论