Query ip address
We use the ip addr command on linux to query the ip address
ip addr
ip address to view the address
Check whether the ip address is smooth
We use the ping command on linux to check whether the ip is smooth
ping 192.168.126.129
Description ip smooth
If the ip is not displayed, or there is a problem with the network card, then execute the following command:
service NetworkManager stop
chkconfig NetworkManager off 永久关闭 Manager网卡
service network restart 重启network网卡
Modify ip address
The first step-find the directory of the ip address
If I need to change the ip address, I must enter the ip address directory, the directory is as follows:
cd /etc/sysconfig/network-scripts/
The second step-modify the ip address
1.1- If you modify it, first find the ifcfg-ens33 file in the ip address directory
1-2-vim to enter the file
vim ifcfg-ens33
1-3-Modify the ip address after entering the file
After entering the IPADDR, I will change our ip
Step 3-Restart the ip address
我们重启ip的话使用以下命令:
service network restart
The same as shown in the picture indicates a successful restart
The fourth step-check the ip address (whether it was successfully modified)
ip addr