编辑文件
vim /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
#网卡
ens192:
dhcp4: false
addresses:
- 192.168.1.100/24
gateway4: 192.168.1.1
nameservers:
addresses: [61.177.7.1, 4.4.4.4]
version: 2
自动获取
编辑文件
vim /etc/netplan/00-installer-config.yaml
DHCP IP
# This is the network config written by 'dhcp'
network:
ethernets:
#网卡
ens192:
dhcp4: true
version: 2