Ubuntu2204网卡配置已经弃用gateway4,若设置gateway4作为默认路由会报如下错误。

** (process:2659): WARNING **: 07:43:39.575: `gateway4` has been deprecated, use default route
See the 'Default routes' section of the documentation for more details.

所以采用新的写法来设置默认路由。

root@k8s-1:~# cat /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
  ethernets:
    ens33:
      dhcp4: false
      addresses:
      - 192.168.10.128/24
      optional: true
      routes:
        - to: default
          via: 192.168.10.254
      nameservers:
        addresses:
        - 8.8.8.8
  version: 2
文章作者: Administrator
版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 知识武装灵魂
linux ubuntu
喜欢就支持一下吧