前言
ikoula獨服都支援IPv6,不過並沒有自動啟用 需要手動配置。
測試環境
ikoula E3-1220v5 (€14.99/29.99)
Ubuntu 16.04 LTS
網卡名稱eth0,自行替換
配置IPv6
編輯網絡配置文件:
nano /etc/network/interfaces
添加內容 格式如下:
iface eth0 inet6 static address 2a00:c70:1:AAA:BBB:CCC:DDD:1 netmask 96 gateway 2a00:c70:1:AAA:BBB:CCC::1
說明
將AAA:BBB:CCC:DDD替換成服務器的IPv4地址
Ex: IPv4 = 213.246.57.23
iface eth0 inet6 static address 2a00:c70:1:213:246:57:23:1 netmask 96 gateway 2a00:c70:1:213:246:57::1
重啟生效,測試是否配置成功:
ping6 ipv6.google.com
serveripv4=$( ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:" )
interface=$( ifconfig -a | grep -B 1 $serveripv4 | head -n1 | awk '{print $1}' | sed "s/:$//" )
AAA=$( echo $serveripv4 | awk -F '.' '{print $1}' )
BBB=$( echo $serveripv4 | awk -F '.' '{print $2}' )
CCC=$( echo $serveripv4 | awk -F '.' '{print $3}' )
DDD=$( echo $serveripv4 | awk -F '.' '{print $4}' )
cat>>/etc/network/interfaces<<EOF
iface $interface inet6 static
address 2a00:c70:1:$AAA:$BBB:$CCC:$DDD:1
netmask 96
gateway 2a00:c70:1:$AAA:$BBB:$CCC::1
EOF
systemctl restart networking.service
ping6 -c 5 ipv6.google.com