打开IP地址配置文件
root@mysql-master:~/.ssh# vim /etc/netplan/00-installer-config.yaml
配置信息如下:
# This is the network config written by 'subiquity'
network:
ethernets:
ens33:
dhcp4: no
addresses: [192.168.206.100/24]
gateway4: 192.168.206.1
nameservers:
addresses: [ 8.8.8.8 ]
version: 2
保存退出并重启网卡
root@mysql-master:~/.ssh# netplan apply
查看修改ip是否生效
ip a 或者ifconfig
root@mysql-master:~# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.206.100 netmask 255.255.255.0 broadcast 192.168.206.255
inet6 fe80::20c:29ff:fe26:418 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:26:04:18 txqueuelen 1000 (Ethernet)
RX packets 25949 bytes 32082286 (32.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8864 bytes 821106 (821.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
到这就完成啦
下面是配置多ip,首先打开ip的配置文件
root@mysql-master:~# vim /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
ens33:
dhcp4: no
addresses: [192.168.206.100/24] #以此类推配置多个
addresses: [192.168.206.101/24]
addresses: [192.168.206.102/24]
gateway4: 192.168.206.1
nameservers:
addresses: [ 8.8.8.8 ]
version: 2
改完配置文件,重启生效验证
# This is the network config written by 'subiquity'
network:
ethernets:
ens33:
dhcp4: no
addresses: [192.168.206.100/24]
addresses: [192.168.206.101/24]
addresses: [192.168.206.102/24]
gateway4: 192.168.206.1
nameservers:
addresses: [ 8.8.8.8 ]
version: 2
完成