全球主机交流论坛

标题: 关于Ubuntu ipv6 的疑问 [打印本页]

作者: Delly    时间: 2023-3-13 09:48
标题: 关于Ubuntu ipv6 的疑问
用Ubuntu 当软路由(目前只是作为旁路由使用),目前/etc/netplan/00-installer-config.yaml的配置如下:
network:
  ethernets:
    eno1:
      dhcp4: true
    enp1s0:
      dhcp4: true
    enp4s0:
      dhcp4: true
    enp2s0:     
      addresses: [192.168.1.xx/24]   
      dhcp4: true   
      optional: true
      routes:
        - to: default
          via: 192.168.1.1   
      nameservers:
         addresses: [114.114.114.114,223.5.5.5]   
  version: 2
  renderer: networkd

请问怎样同时开启ipv6?并且设置ipv6优先?目前我只是用了enp2s0这个网口作旁路由  谢谢!
作者: iamydp    时间: 2023-3-13 09:54
dhcp6开启就好了,你问问chatgpt
作者: Delly    时间: 2023-3-13 13:04
iamydp 发表于 2023-3-13 09:54
dhcp6开启就好了,你问问chatgpt

貌似上级路由已经开启了,但是本机并不是ipv6优先
作者: cloverzrg    时间: 2023-3-13 14:19

  1. sysctl -w net.ipv6.conf.all.route_metric=10
复制代码


To set IPv6 as the priority protocol in Ubuntu 22.04, you can open a terminal and run the command sudo sysctl -w net.ipv6.conf.all.route_metric=10. This will set the route metric for IPv6 to 10, making it the preferred protocol.




欢迎光临 全球主机交流论坛 (https://hostloc.9hanju.com/) Powered by Discuz! X3.4