The network of our office today is not stable, every time will be broken off, and then please the network of colleagues to deal with a bit, said that some of the router configuration conflict, so he will IP address made some changes, For example: The original IP is 192.168.0.110, now you need to change to 192.12.2.110. We have a test server whose IP is fixed, so we need to modify it-- The original is 192.168.0.202, now need to change to 192.12.2.202, this thing has been done once, but the time is too long to remember not clear, so on Baidu a bit, found that the article on the network can not be very accurate to solve my problem, I refer to a number of network technical documents, experiment several times to solve this problem, the To be recorded here for later use.
1: To modify some of the configuration files need to use the root user's permission, so here directly switch to the root user to operate, can see--linux Learning notes-switch and replace the user identity command--su
2: Different operating system version there is a certain difference, so you need to look at your own operating system information, you can see--linux study notes-View Linux System Information method
3: Before and after modifying the corresponding configuration file needs to see if our changes take effect, you can use the ifconfig command to view
4: Configure a static IP address using the vim/etc/network/interfaces command
5: Configure DNS server address using the vim/etc/resolv.conf command
6: This step is more critical, because in the process of testing found that the restart of the machine is still unable to access the Internet, the problem is /etc/resolv.conf. After the restart, the DNS for this file configuration is automatically modified for the default value.
Therefore, you need to permanently modify DNS using the vim/etc/resolvconf/resolv.conf.d/base command
7: Restart the machine so that our modified network configuration takes effect
8: Reference
(summary) Ubuntu Server 12.04 static IP compact Configuration
Ubuntu Kylin 14.04-Modify IP fixed Address