配置网络
为虚拟机配置固定静态IP
su root
dhclient
ifconfig
编辑
vim /etc/sysconfig/network-scripts/ifcfg-ens33
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=824ec4bd-a9ae-4410-8346-17ce7f3dd111
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.31.21
NETMASK=255.255.255.0
GATEWAY=192.168.31.1
DNS1=119.29.29.29
编辑完成,重启网络设置即可
systemctl restart network.service
关闭防火墙
查看防火墙状态
systemctl status firewalld.service
关闭防火墙
systemctl stop firewalld.service
禁止防火墙开机自启
systemctl disable firewalld.service