1.输入ip a查看是否有对应的网卡ip
更改前:
更改后:
具体看下面博客的步骤,这里不详细赘述
(137条消息) Linux虚拟机联网步骤(修改网络配置信息)_袁梦码的博客-CSDN博客_怎么让linux虚拟机联网
2.关闭防火墙
永久关闭防火墙(就是设置虚拟机开机默认防火墙关闭)俩个命令连续使用
systemctl stop firewalld 先关闭本次的防火墙
systemctl disable firewalld 再设置每次启动时自动关闭防火墙
3.相关命令展示
系统控制命令:(centos独有的)
systemctl (system controler系统控制命令)
1、systemctl start 服务名 用于启动某个服务
2、systemctl restart 服务名 用于重启某个服务
3、systemctl stop 服务名 用于停止某服务
4、systemctl status 服务名 用于查看某个服务的状态
Eg: systemctl status network 查看网络的状态
systemctl stop network 关闭网络
systemctl restart network 重启网络
systemctl start network 启动网络
Eg: systemctl status firewalld 查看防火墙的状态
systemctl stop firewalld 关闭防火墙
systemctl restart firewalld重启防火墙
systemctl start firewalld 启动防火墙