# 达拉斯默认网关
root@server2:~# ip -6 route show default
default via 2604:9cc0:1801::1 dev eth0 metric 1024 onlink pref medium
root@server2:~# cat /etc/resolv.conf
# Generated by resolvconf
nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 2606:4700:4700::1111
nameserver 2001:4860:4860::8888
# 添加ip
ip -6 addr add 2604:9cc0:1888::a/64 dev eth0
# 删除默认路由
ip -6 route del default
#如果你有多个默认路由,需要加上具体网关和接口:
ip -6 route del default via <网关地址> dev eth0
# 添加路由
ip -6 route add default via <新的网关地址> dev eth0
# 检查测试
sysctl net.ipv6.conf.all.disable_ipv6
ip -6 addr show dev eth0
ip -6 route show
ping6 google.com
# spartanhost Dallas 达拉斯默认配置
root@server2:~# cat /etc/network/interfaces
source /etc/network/interfaces.d/*
root@server2:~# cd /etc/network/interfaces.d/
root@server2:/etc/network/interfaces.d# cat 50-cloud-init
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
auto lo
iface lo inet loopback
dns-nameservers 1.1.1.1 8.8.8.8 2606:4700:4700::1111 2001:4860:4860::8888
auto eth0
iface eth0 inet static
address 1.1.1.1/24
dns-nameservers 1.1.1.1 8.8.8.8 2606:4700:4700::1111 2001:4860:4860::8888
gateway 1.1.1.1
dns {'nameservers': ['1.1.1.1', '8.8.8.8', '2606:4700:4700::1111', '2001:4860:4860::8888'], 'search': []}
# control-alias eth0
iface eth0 inet6 static
address 2604:9cc0:1801::fff/126
gateway 2604:9cc0:1801::1
# control-alias eth0
iface eth0 inet6 static
address 2604:9cc0:fff::a/48
# control-alias eth0
iface eth0 inet6 static
address 2604:9cc0:fff::b/48