cd /etc/sysconfig/network-script/
找到对应的ifcfg-entxxxx文件,然后添加网关,修改dhcp为static,静态ip,添加IPADDR ip地址.onboot = yes开机启动
TYPE=Ethernet BOOTPROTO=static GATEWAY=192.168.1.1 IPADDR=192.168.1.123 DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no NAME=eno16777736 UUID=4e283aaf-f8a6-4512-ad29-e44b5a6e8f67 DEVICE=eno16777736 ONBOOT=yes
DNS
vim /etc/resolve.conf
添加
nameserver 114.114.114.114
重启网络
service NetworkManager restart
更换yum为网易源
cd /etc/yum.repos.d/ wget http://mirrors.163.com/.help/CentOS7-Base-163.repo mv CentOS7-Base-163.repo /CentOS7-Base.repo yum makecache