Centos7 default installation is not enabled to configure network card information, unable to access the extranet.
The bottom configuration opens the network to get the IP address automatically
1. View network card information
Executive Ifconfig
eno16777736:flags=4163<up,broadcast,running,multicast> MTU inet 6 fe80::20c:29ff:fee8:8637 prefixlen ScopeID 0x20<link> ether 00:0c:29:e8:86:37 txqueuelen (ether NET) Rx packets 1121 Bytes 98968 (96.6 KiB) Rx Errors 0 dropped 0 overruns 0 frame 0 TX packets 1 Bytes 25233 (24.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo:flags=73<up,loopback,ru Nning> MTU 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6:: 1 prefixlen ScopeID 0x10
eno16777736 represents the name of the network card, and Ether 00:0c:29:e8:86:37 represents the MAC address of the NIC
2. Configure the network adapter to start networking
cd/etc/system/network-scripts/
VI ifcfg-eno16777736
hwaddr=00:0c:29:e8:86:37TYPE=Ethernetbootproto=Dhcpdefroute=Yespeerdns= yespeerroutes=yesipv4_failure_fatal=noipv6init=yesipv6_autoconf= Yesipv6_defroute=Yesipv6_peerdns=yesipv6_peerroutes=yesipv6_failure_fatal= NoNAME=eno16777736uuid=79d6c916-aab8-45e4-a163-37ae73393d26onboot=no
Change onboot= No to Onboot=yes
3. Restart the network
Service Network restart
4. Re-execution of Ifconfig
Eno16777736:flags=4163<up,broadcast,running,multicast> MTU 1500inet192.168.159.128 netmask 255.255.255.0 Broadcast 192.168.159.255Inet6 Fe80::20c:29ff:fee8:8637 Prefixlen ScopeID 0x20<link>ether00:0c:29:e8:86:37 Txqueuelen 1000(Ethernet) RX packets1699 bytes 140091 (136.8KiB) RX Errors0 dropped 0 overruns 0 frame 0TX Packets333 bytes 42669 (41.6KiB) TX Errors0 dropped 0 overruns 0 carrier 0 collisions 0Lo:flags=73<up,loopback,running> MTU 65536inet127.0.0.1 netmask 255.0.0.0Inet6::1 Prefixlen ScopeID 0x10Loop Txqueuelen0(Local Loopback) RX packetsBytes 78372 (76.5KiB) RX Errors0 dropped 0 overruns 0 frame 0TX PacketsBytes 78372 (76.5KiB) TX Errors0 dropped 0 overruns 0 carrier 0 collisions 0
inet 192.168.159.128 represents an IP address
Centos 7 turns on network card to get IP automatically