1.配置网卡、可联网模式
[root@centos7 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE="Ethernet"
BOOTPROTO="none"
NAME="eth0"
UUID="e4a787e2-4ca6-4514-ae61-5fa6dc438812"
DEVICE="eth0"
ONBOOT="yes"
IPADDR=192.168.37.7
PREFIX=24
#DNS
DNS1=114.114.114.114
#网关
GATEWAY=192.168.37.2
#重启网络服务
[root@centos7 ~]# systemctl restart network
#ping 百度通了
[root@centos7 ~]# ping baidu.com -c 2
PING baidu.com (220.181.38.251) 56(84) bytes of data.
64 bytes from 220.181.38.251 (220.181.38.251): icmp_seq=1 ttl=128 time=7.24 ms
64 bytes from 220.181.38.251 (220.181.38.251): icmp_seq=2 ttl=128 time=7.28 ms
--- baidu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1009ms
rtt min/avg/max/mdev = 7.247/7.265/7.283/0.018 ms
2.配置网络yum源
1.把原来的库移动到备份文件夹
2.阿里云进行下载:https://developer.aliyun.com/mirror/
#base源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
#epel源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
#清理本地缓存
[root@centos7 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base epel extras updates
Cleaning up list of fastest mirrors
#显示仓库列表
[root@centos7 yum.repos.d]# yum repolist
3.本地yum源
yum install autofs -y
systemctl start autofs
systemctl enable autofs
vim /etc/yum.repos.d/base.repo
[base]
name=base
baseurl=file:///misc/cd
gpgcheck=0
https://blog.youkuaiyun.com/lamp_yang_3533/article/details/62222215