安装dhcpcd
# 安装dhcpcd
apk add dhcpcd
# 添加dhcpcd服务
rc-update add dhcpcd
# 启动dhcpcd服务
rc-service dhcpcd start
添加路由通告
cat <<EOF > /etc/sysctl.conf
net.ipv6.conf.all.accept_ra = 2
net.ipv6.conf.default.accept_ra = 2
net.ipv6.conf.eth0.accept_ra = 2
net.ipv6.conf.eth0.autoconf = 1
EOF
添加网卡支持ipv6 dhcp
注:eth0需要更换为自己的网卡名
cat <<EOF >/etc/network/interfaces
iface eth0 inet6 dhcp
EOF
评论区