Set network, IP address, and CentOS network IP address
1. log on to CentOS.
2. # dhclient automatically obtains the IP address
3. # ip addr
1). the first address 127.0.0.1 is the loopback address, and the NIC name is lo. This address is also available in Windows and can be used to communicate with you.
2). The second IP address 192.168.123.130 is the IP address automatically obtained. Ens33 is the name of the NIC.
4. After obtaining the IP address, check whether the IP address can be connected to the Internet.
# Ping-c 4 www.baidu.com
5. vi/etc/sysconfig/network-scripts/ifcfg-ens33
ONBOOT = no changed to yes indicates that the online publication starts with the system.
BOOTPROTO = changing dhcp to static. dhcp indicates dynamic retrieval, and static indicates manual setting of static IP addresses.
And add
IPADDR = 192.168.123.130 specified IP Address
NETMASK = 255.255.255.0 Subnet Mask
GATEWAY = 192.168.123.2 GATEWAY
DNS1 = 119.29.29.29
6. Restart the network service.
# Systemctl restart network. service
7. View IP addresses
# Ip addr
8. Network Connectivity
# Ping-c 4 www.baidu.com