First, Course notes:
1. Command changes:
View Network
IP Add (7.x)
Ifconfig (6.x)
Yum install-y net-tools using the ifconfig command after 7
Restart Service
Systemctl Restart Network.service (7.x)
Service Network restart (6.x)
2. NIC configuration file changes
/etc/sysconfig/network-scripts/ifcfg-enxx/ethxx
Ifcfg-enxx (7.x)
Ifcfg-ethxx (6.x)
Second, the experiment
Configure IP
Enter your account password in the system console
View current NIC Information
[[email protected]] #ip add
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/A7/69/wKioL1nmHTfx8WruAADpFV5l8Vc963.png-wh_500x0-wm_ 3-wmp_4-s_2832487150.png "title=" 1.2.png "alt=" Wkiol1nmhtfx8wruaadpfv5l8vc963.png-wh_50 "/>
-
Attempt to obtain the IP address
[[email protected] "#dhclient
run again view NIC command
[[email protected]] #ip add
650) this.width=650; "Src=" Https://s2.51cto.com/wyfs02/M02/08/B9/wKiom1nmH5Dz_D84AAE26HYBrEg663.png-wh_ 500x0-wm_3-wmp_4-s_4106449765.png "title=" 1.1.png "alt=" wkiom1nmh5dz_d84aae26hybreg663.png-wh_50 "/>
Note the IP information of the 2:ENS33 network card, and if you cannot obtain an IP address, see vmware workstion The network editor of the software, verify that the network that the NIC is connected to has DHCP enabled (the experiment environment is turned on by default), or write down the corresponding network parameters directly.
-
Edit Network card profile
move the cursor to where it needs to be modified, press key, and the lower-left corner of the screen shows "INSERT" identifies the edit state
Found the following two parameters and modified
bootproto=static
Onboot=yes
Move the cursor to the last line to add the following parameters,
ipaddr=172.16.107.158 (IP address acquired by the machine)
netmask=255.255.255.0 (Subnet mask)
gateway=172.16.107.2 (Gateway)
dns1=61.139.2.69 (Domain name resolution server, each province is different, please own Baidu)
Save exit
Method: Press "ESC" key, enter ": Wq", then press "enter", at this time return to the prompt interface, the cursor flashes
Restart Network Service
[email protected]]#systemctl Restart Network.service
Test network
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/08/B9/wKiom1nmISGDMKu5AADhsyjPzjA740.png-wh_500x0-wm_ 3-wmp_4-s_19181533.png "title=" 1.3.png "alt=" Wkiom1nmisgdmku5aadhsyjpzja740.png-wh_50 "/>
After you enter ping www.adminglinux.com, you can resolve to an IP address with a return value indicating that the network configuration is correct
Also have encountered can resolve to the IP address, but the return value is: timeout, it is possible that the site Ping, it is recommended to test several sites
During the test, if you encounter
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/A7/69/wKioL1nmIFryIEpaAAAu78QTKQQ531.png-wh_500x0-wm_ 3-wmp_4-s_3917281867.png "title=" 1.4.png "alt=" Wkiol1nmifryiepaaaau78qtkqq531.png-wh_50 "/>
Please check that the DNS configuration is correct
Connect:network is unreachable
Please verify that the gateway is configured correctly, as follows
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/08/BA/wKiom1nmI_zgbUfxAABbdIRjckU064.png "title=" 1.5. PNG "alt=" Wkiom1nmi_zgbufxaabbdirjcku064.png "/>
10. If you are sure the configuration is correct and you are still unable to connect to the Internet, it is recommended that you remove the network card, add another one, or go to the network editor in VMware workstion to remove and rebuild the appropriate networks.
At this point, the IP configuration of the CENTOS7 virtual machine is over. See you next time!
This article is from the "Everything Must and Spring, JAS" blog, please be sure to keep this source http://badswolf.blog.51cto.com/6725328/1973585
1 week 2nd lesson Linux Configuring IP network Troubleshooting CENTOS7