VMware Workstation 下的 CentOS 使用固定 IP

VMware Workstation 下的 CentOS 使用固定 IP

简略写下,有空补充详细。

VMware Workstation

image-20200913205506776

windows

find the VMware Workstation NAT Network Adapter, then change the IPV4 config:

image-20200913205419340

CentOS network config

sudo vi /etc/sysconfig/network-scripts/ifcfg-ens33

content:

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=7ef0da97-7e3f-4052-85e5-e90c8386167f
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.11.6
GATEWAY=192.168.11.2
NETMASK=255.255.255.0
DNS1=192.168.11.2

network.service isn't available on CentOS8 by default, so we should use NetworkManager.service and restart it:

sudo systemctl restart NetworkManager
# or use the below command:
# sudo nmcli connection reload

Check either IP is changed:

ip addr

output:

image-20200913210218875

done!

加载评论