在 /etc/netplan/50-cloud-init.yaml
下配置靜態(tài)網(wǎng)絡:
network:
ethernets:
eth0:
dhcp4: false
addresses: [192.168.1.11/24]
optional: true
gateway4: 192.168.1.1
nameservers:
addresses: [192.168.1.1]
version: 2
配置完成后應用網(wǎng)絡配置的時候出現(xiàn)以下報錯:
root@k8s-master-01:~# netplan apply
** (generate:234574): WARNING **: 14:21:04.809: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.
** (process:234572): WARNING **: 14:21:06.172: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.
root@k8s-master-01:~#
報錯的意思是說,gateway4
已被棄用,請改用默認路由。默認路由就是通過 routes
配置 IP
。
修改網(wǎng)絡配置如下:文章來源:http://www.zghlxwxcb.cn/news/detail-676786.html
network:
ethernets:
eth0:
dhcp4: false
addresses: [192.168.1.11/24]
optional: true
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses: [192.168.1.1]
version: 2
應用網(wǎng)絡配置:文章來源地址http://www.zghlxwxcb.cn/news/detail-676786.html
netplan apply
到了這里,關于Ubuntu 報錯 WARNING:gateway4 has been deprecated, use default routes instead... 解決方案的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!