method One,
1, open vi/etc/sysconfig/network-scripts/ifcfg-enp4s0 (each machine may be different, but the format will be "Ifcfg-e ..."). But the content contains:
- <strong>type=Ethernet #网卡类型
- device=eth0 #网卡接口名称
- onboot=No #系统启动时是否自动加载
- bootproto= static#启用地址协议--static: Static protocol--BOOTP Protocol--DHCP Protocol
- Ipaddr=192.168.1.11 #网卡IP地址
- netmask=255.255.255.0 #网卡网络地址
- gateway=192.168.1.1 #网卡网关地址
- Hwaddr=00:0c:29:13:5d:74 #网卡设备MAC地址
- broadcast=192.168.1.255 #网卡广播地址</strong>
The contents of the amendment are as follows:
- onboot=Yes
- nm_controlled=No
- bootproto=DHCP
- dns1=8.8.8.8
- dns2=4.2.2.2
(Press the I key to enter DNS1 ,DNS2 ,nm_controlled and modify Bootproto,onboot; then press ESC, and then enter ": Wq" to save the exit )
2. Restart the network: Service network restart
Centos7:python installation. Yum Install software tips cannot find a valid baseurl for repobase7x86_64