甲骨文 arm 机子,网页面板上已经分配好了 ipv6 地址,主机改了/etc/network/interfaces
文件:
iface enp0s3 inet static
address 10.0.0.72/24
gateway 10.0.0.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8
dns-search debian
iface enp0s3 inet6 dhcp
dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888
然后又在/etc/sysctl.conf
文件加了一句:echo "net.ipv6.conf.all.disable_ipv6=0"
重启后通过ip addr
得到:
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 02:00:17:02:99:ec brd ff:ff:ff:ff:ff:ff
inet 10.0.0.72/24 brd 10.0.0.255 scope global enp0s3
valid_lft forever preferred_lft forever
inet6 2603:c022:800d:ipv6:ipv6:ipv6:ipv6:ipv6/128 scope global
valid_lft forever preferred_lft forever
inet6 fe80::17ff:fe02:99ec/64 scope link
valid_lft forever preferred_lft forever
对比面板的 ipv6 一致,然而ping6 google.com
得到的还是ping6: connect: Network is unreachable
。大佬们救救我吧,实在是搞不定了。
1
placeholder 2022-10-01 21:42:00 +08:00
据说是 /etc/gai.conf
去掉注释 #precedence ::ffff:0:0/96 100 从论坛里看到的,不知道准不准 |
2
placeholder 2022-10-01 21:42:30 +08:00
哦好像答不对题啊,op 忽略吧
|
3
skybig OP @placeholder 看了下你说的那行的注释,死马当活马医,不过还是没成。感谢。
|
4
tmux123 2022-10-01 21:51:34 +08:00
ip -6 route 看看输出
|
5
skybig OP @tmux123
::1 dev lo proto kernel metric 256 pref medium 2603:c022:800d:ipv6:ipv6:ipv6:ipv6:ipv6 dev enp0s3 proto kernel metric 256 pref medium fd00:dead:beef:c0::/80 dev docker0 proto kernel metric 256 pref medium fd00:dead:beef:c0::/80 dev docker0 metric 1024 pref medium fe80::/64 dev enp0s3 proto kernel metric 256 pref medium fe80::/64 dev docker0 proto kernel metric 256 pref medium fe80::/64 dev br-d8b7e473755c proto kernel metric 256 pref medium fe80::/64 dev br-d24bac5dba6c proto kernel metric 256 pref medium fe80::/64 dev vethf75df3d proto kernel metric 256 pref medium fe80::/64 dev veth21cfd44 proto kernel metric 256 pref medium fe80::/64 dev vethf988815 proto kernel metric 256 pref medium fe80::/64 dev veth718c955 proto kernel metric 256 pref medium fe80::/64 dev veth2dc1e3b proto kernel metric 256 pref medium fe80::/64 dev vethc56bd42 proto kernel metric 256 pref medium fe80::/64 dev vethd12ebbb proto kernel metric 256 pref medium |
6
tmux123 2022-10-01 22:06:00 +08:00
不是很了解……猜测两个方向:
1. 检查 sysctl 的 net.ipv6.conf.eth0.accept_ra 是不是 1 ; 2. 手动添加默认路由试试 这是我机器上的输出( ubuntu ) ::1 dev lo proto kernel metric 256 pref medium 2603:xxxx:xxxx:xxxx::/64 dev enp0s3 proto ra metric 100 pref medium 2603:xxxx:xxxx:xxxx::/64 dev enp0s3 proto kernel metric 256 pref medium fe80::/64 dev enp0s3 proto kernel metric 256 pref medium default via fe80::200:xxxx:xxxx:xxxx dev enp0s3 proto ra metric 100 expires 8969sec pref medium |
8
ysc3839 2022-10-01 23:28:04 +08:00 via Android
换成 NetworkManager 试试?我虚拟机 Kubuntu 的 IPv6 SLAAC 是没问题的。
|
9
tril 2022-10-01 23:39:52 +08:00
建议先看看原系统的 ip -6 route 的输出和网卡配置文件,有了这些才好在新系统上改。有配额的话开台 amd 的 ubuntu 对照看看吧。
|
12
xratzh 2022-10-02 00:21:27 +08:00
我记得我当时绿云没有 V6 ,是因为默认的 gateway 参数错了。可以完整配置一下。再 systemctl restart networking.service
`` auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 69.161.221.XXX gateway 69.161.221.1 netmask 255.255.255.0 dns-nameservers 8.8.8.8 8.8.4.4 up ip addr add 2402:a7c0:8100:a015::XXX:XXX/112 dev eth0 up ip -6 route add 2402:a7c0:8100:XXX:0000:0000:0000:0001 dev eth0 up ip -6 route add default via 2402:a7c0:8100:XXX:0000:0000:0000:0001 `` |
13
buxiaozisun 2022-10-02 00:29:43 +08:00 via Android
甲骨文是 dhcp 的 不需要手动设置 其他网卡的话用 secondary_vnic_all_configure.sh 这个脚本
|
14
loveqianool 2022-10-02 00:43:36 +08:00 via Android 2
```
sudo mv /etc/network/interfaces /etc/network/interfaces.save sudo sh -c "echo '[Match] Name=enp0s3 [Network] DHCP=yes' >> /etc/systemd/network/z.network" sudo systemctl enable systemd-networkd sudo systemctl restart systemd-networkd sudo systemctl status systemd-networkd ``` |
15
skybig OP @buxiaozisun 所以很奇怪啊,dhcp 获得了 ipv6 的地址,但是却没法 ping 出去。
|
16
buxiaozisun 2022-10-02 20:53:28 +08:00 via Android
@skybig 应该是直接就能用啊,有可能是你安全组没设置 ipv6 出 你去虚拟云网络那边看看
|
17
skybig OP @loveqianool 完美解决。大佬 nb ,搜了下 systemd-networkd.service 明白你设置 z.network 的作用了。
|
18
ingnoscemihi 2022-10-10 21:37:14 +08:00
iface 网口 inet6 dhcp
|