一、输入命令
vim /etc/sysconfig/network-scripts/ifcfg-ens33
按回车进入图一
二、将ONBOOT=no改为ONBOOT=yes
按shitf+a进入编辑模式,改完按ESC退出编辑模式,按shift+:再输入wq回车![](https://img-blog.csdnimg.cn/direct/7ff54e99dbaa4afc871451acc30a92d7.png)
三、重启网络服务
输入命令sudo service network restart
四、查看网卡是否开启成功
输入命令ip addr
出现ip地址则说明开启成功
五、开启失败的解决方法
第一种可能是VMware的网络配置出现问题。
将其改为NAT模式,或者删除重新安装。
第二种可能是VMware的网络服务未开启。
创建bat文件运行下列代码。
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit cd /d "%~dp0"
@echo off
net start "VMware NAT Service"
if %errorlevel% == 0 (
echo ...
) else (
echo 启动 VMware NAT服务失败
)
net start "VMnetDHCP"
if %errorlevel% == 0 (
echo ...
) else (
echo 启动 VMware DHCP服务失败
)
pause