1. Open the Linux terminal system and enter the following code in the system. (Recommended learning: linux tutorial)
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
2. Then start filling in the ip address, subnet mask, gateway, etc. The command code is as shown in the figure.
3. After filling in the terminal, save and exit.
4. Then restart the network service. The code in the red box is the code for restarting.
5. Then ping the gateway and test it on the external network. If it passes normally, it will be OK.
The above is the detailed content of How to set ip in linux. For more information, please follow other related articles on the PHP Chinese website!