Linux to modify the IP address is usually used to modify the ifconfig, but this modification is very troublesome, the following small series to introduce the use of the command to change the IP address method, together to learn under it.
Method/Step
1, use the root user login into Linux, open in the terminal
2, in the terminal input: Vi/etc/sysconfig/network-scripts/ifcfg-eth0
3, after carriage,
Start editing, fill in the IP address, subnet mask, gateway, DNS, and so on. The "information in the red box" is necessary.
4, after editing, save exit
Restart Network Services
Service network restart or/etc/init.d/network restart
Then ping the gateway and ping the extranet for testing. Can ping to indicate that the network is normal
5, Detailed summary:
---Modify the IP address---
Immediate effect:
# ifconfig eth0 192.168.1.155 netmask 255.255.255.0
Reboot effective:
Modify Vi/etc/sysconfig/network-scripts/ifcfg-eth0
---Modify the default gateway---
Immediate effect:
# route add default GW 192.168.1.1
Reboot effective:
Modify Vi/etc/sysconfig/network-scripts/ifcfg-eth0
---modify DNS---
Modify Vi/etc/resolv.conf
Immediately after the change, restart is also effective
---Modify the host name---
Immediate effect:
# hostname Test1
Reboot effective:
Modify Vi/etc/sysconfig/network
End
Attention matters
Not familiar with practice more than a few times
The above is the use of Linux under the command to easily modify the IP address method Introduction, hope to help everyone!
Above is the Linux to modify the IP address method introduced, if you need to modify the IP address, installation of the steps described above can easily complete IP changes, you have learned?