1.修改网络
先命令 ip addr
查看自己网卡的名称
然后编辑 vi /etc/sysconfig/network-scripts/ifcfg-ens33
centos7 我的网卡名字是ens33
把ONBOOT=no 改成yes
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
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=0fda965c-0ec3-4143-81e6-24e7ab5ae77d
DEVICE=ens33
ONBOOT=yes
然后重启 service network restart
2.问题2 使用不了yum 命令
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
To enable Red Hat Subscription Management repositories:
subscription-manager repos --enable <repo>
To enable custom repositories:
yum-config-manager --enable <repo>
步骤1 备份yum 数据源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
步骤2 下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
下载地址centos7:http://mirrors.163.com/.help/CentOS7-Base-163.repo
下载地址centos6:http://mirrors.163.com/.help/CentOS6-Base-163.repo
步骤3
运行以下命令生成缓存
yum clean all
yum makecache
结束!