第一步
先找到那个管事的
cd /etc/sysconfig/network-scripts/
vi ifcfg-ens33
把ONBOOT=NO 改成 YES,然后保存退出。
第二步
重启网络服务
service network restart
第三步
安装网络工具
yum install net-tools
如果以上提示了
yum install net-tools安装报错could not resolve host: mirrorlist.centos.org 下面是解决办法
备份当前的yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载新的CentOS-Base.repo 到/etc/yum.repos.d/
## 根据自己的版本选择相应的命令
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo