|
今天把斯巴达小鸡dd最新ubuntu 20.04后发现在netplan中配置ipv6地址无效,经过一番尝试,发现是网关配置问题,因为netplan认为网关不属于IP地址/64的网络,不能使用gateway6参数,而是要配置routes,下面贴出配置
斯巴达家的ipv6地址可以在控制面板中查到,格式类似于:2604:9cc0:0000:aaaa:0000:0000:0000:0001/64
则网关地址为:2604:9cc0::1
将下面代码中的ipv6_address替换为ipv6地址(如:2604:9cc0:0000:aaaa:0000:0000:0000:0001/64),ipv6_gateway替换为网关地址(如:2604:9cc0::1),命名为ipv6.yaml,移动到/etc/netplan中,执行netplan apply即可- # This file describes the network interfaces available on your system# For more information, see netplan(5).network: version: 2 renderer: networkd ethernets: ens3: accept-ra: false addresses: [ ipv6_address ] nameservers: addresses: - "2001:4860:4860::8888" - "2001:4860:4860::8844" routes: - to: "ipv6_gateway/128" scope: link - to: "::/0" via: "ipv6_gateway" on-link: true
复制代码 |
|