虚拟机配置网络

先找到目录

 

 可以看到ifcfg-ens33

 

 然后编辑

 

 主要改这两部分  dhcp -> static  onboot -> yes然后再加上IP MASK GATEWAY DNS等信息就可以了

 

 配置完之后重启网络

systemctl restart network.service

 

安装nginx 安装完宿主机可以ping通但是不能访问80端口的话 就是centos防火墙的问题  关闭就好

 

1:查看防火状态

systemctl status firewalld

service  iptables status

2:暂时关闭防火墙

systemctl stop firewalld

service  iptables stop

3:永久关闭防火墙

systemctl disable firewalld

chkconfig iptables off

4:重启防火墙

systemctl enable firewalld

service iptables restart  

posted @ 2020-08-17 12:30  Tudoo  阅读(120)  评论(0编辑  收藏  举报