Modify the IP address under Linux usually use ifconfig to modify, but this modification is very troublesome, the following small series for everyone to introduce the method of using the command to change the IP address, let's learn together.
Method /
1, using the root user logs into linux, opens into the terminal
2, the terminal type: vi /etc /sysconfig /network -scripts /ifcfg-eth0
3, press Enter,
start editing, fill in the ip address, subnet mask, gateway, DNS and so on. Among them, the information in the red box is a must.
4, after editing, save and exit
Network Service Restart
service network restart or /etc/init.d/network restart
Then ping the gateway and ping the external network for testing. Can ping通 to indicate that the network is normal
5, detailed summary:
---Modify ip address---
Effective immediately:
# ifconfig Eth0 192.168.1.155 netmask 255.255.255.0
Restart takes effect:
Modify vi /etc/sysconfig/network-scripts/ifcfg-eth0
---Modify default gateway- --
Effective immediately:
# route add default gw 192.168.1.1
Restart takes effect:
Modify vi /etc/sysconfig/network-scripts /ifcfg-eth0
---Modify dns---
Modify vi /etc/resolv.conf
Immediately after modification, restart is also effective
---Modify host name---
Effective immediately:
# hostname test1
Restart takes effect:
Modify vi /etc/sysconfig /network
END
Precautions
Not familiar with practice more than a few times
The above is the use of linux to easily modify the ip address method, I hope to Help everyone!
The above is the method of modifying the ip address under Linux. If you need to modify the ip address, you can easily complete the ip change by installing the steps described above. Have you learned it?
If you have learned about the Linux kernel, then you should have a certain understanding of the prin
We all know that Windows systems have disk fragmentation, but not on Linux, how can
The Vi editor is a text editor for Linux. It is widely used in Linux systems. Many friends have prom
In Linux system, use Ctrl+Alt+Del shortcut combination to quickly restart the syste
Linux operation and maintenance needs to master the command summary
Ubuntu installs AMD proprietary driver steps
How to solve the omitting directory error when copying files in Linux?
The difference between Apache and Tomcat in Linux system is
Linux can not delete users with urserdel?
Ubuntu how to set up system update reminder
How Ubuntu implements screen-to-cut
How to install Guake terminal to Ubuntu system
What should I do if the Linux boot file rc.local cannot be executed?
Linux function library creation method
Win8 allows IE10 to open all Flash
Win7 security aspects of the detailed explanation
Win 8 search can do more than just find the file
Win10 installation and activation of voice packets
WinXP using IE7 can not download files properly
The system prompts directx installation can not trust the compressed file how to solve?
Windows 7 Lenovo Activation Code
Win10 upgrade KB3081449 update prompt error 0x80070032 how to do