一、编辑文件
kuaibang@k8smaster:~$ sudo nano /etc/netplan/00-installer-config.yaml # This is the network config written by 'subiquity' network: ethernets: ens160: addresses: - 192.168.1.155/24 ## 修改为预定IP gateway4: 192.168.1.1 ## 网关 nameservers: addresses: - 192.168.1.1 ## 修改DNS search: - localhost version: 2
二、重启服务器
sudo reboot
三、查看是否生效
ifconfig