服务器默认是DHCP获取一个IP,由于绑定了多个IP到这台服务器,需要修改配置文件来绑定这些IP。
操作步骤
网络配置文件/etc/netplan/50-cloud-init.yaml
默认配置如下:
network:
version: 2
ethernets:
enp0s6:
dhcp4: true
match:
macaddress: 02:00:17:00:ba:a5
set-name: enp0s6
修改 dhcp4值 为false
增加 addresses 值为"IP/子网掩码"
network:
version: 2
ethernets:
enp0s6:
dhcp4: false
match:
macaddress: 02:00:17:00:ba:a5
set-name: enp0s6
addresses:
- 10.0.0.101/24
- 10.0.0.121/24
- 10.0.0.134/24