使用命令 cd /etc/netpaly/ 先进入当前目录,在使用命令 ls 查看目录下的文件名,因为这里
文件名字可能会不一样,所以最好进去查看一下
使用命令 vi 00-installer-config.yaml 打开此文件修改信息,注意这里vi 后面跟实际文件名字;
# This is the network config written by 'subiquity'
network:
# renderer: NetworkManager
ethernets:
enp4s0:
dhcp4: no
addresses: [192.168.0.106/24]
optional: true
gateway4: 192.168.0.254
nameservers:
addresses: [114.114.114.114]
sudo netplan apply
双网卡静态/动态ip配置:
1.双网卡静态ip配置前面和静态ip操作方法是一样的,就是参数设置不一样:
# This is the network config written by 'subiquity'
network:
# renderer: NetworkManager
ethernets:
enp4s0:
dhcp4: no
addresses: [192.168.0.106/24]
optional: true
gateway4: 192.168.0.254
nameservers:
addresses: [114.114.114.114]
dhcp4: no
addresses: [192.168.25.250/24]
optional: true
gateway4: 192.168.25.253