Set static IP on CentOS
Step 1: Check the current state
After editing the NIC, the NIC IP is 132.0.0.70.
Open Console and check the current IP address with:
ip a
Step 2: Open the network interface configuration file
Open the file ifcfg-eth0 with:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
Step 3: Edit the configuration values
- Press
ito enter Insert mode. - Update the IP address, gateway, and DNS to match the new configuration.
- Press
Esc, type:wq, and pressEnterto save and exit.
Step 4: Restart the network service
Run the following command to apply the changes:
service network restart
Step 5: Verify and test connectivity
Run ip a again to confirm the IP address has been updated, then run a ping test to verify connectivity.





