文件位置:
cd /etc/netplan
后缀为.yaml 的就是配置文件
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
bonds: {}
bridges: {}
ethernets:
ens3:
addresses:
- 10.0.0.6/24
- 10.0.0.7/24
- 10.0.0.8/24
- 10.0.0.9/24
- 10.0.0.10/24
- 10.0.0.10/24
- 10.0.0.12/24
- 10.0.0.13/24
- 10.0.0.14/24
- 10.0.0.15/24
- 10.0.0.16/24
- 10.0.0.17/24
- 10.0.0.18/24
- 10.0.0.19/24
- 10.0.0.20/24
- 10.0.0.21/24
- 10.0.0.22/24
- 10.0.0.23/24
- 10.0.0.24/24
- 10.0.0.25/24
- 10.0.0.26/24
critical: true
dhcp-identifier: mac
dhcp4: true
gateway4: 10.0.0.6
match:
macaddress: 12:00:17:00:d9:6e
nameservers:
addresses:
- 169.254.169.254
search:
- vcn.oraclevcn.com
set-name: ens3
ens5:
addresses:
- 10.0.0.88/24
dhcp4: false
gateway4: 10.0.0.88
match:
macaddress: 12:00:17:00:1c:71
optional: true
sudo netplan apply
应用更改