I have installed Ubuntuserver before. Because ubuntuserver does not have a graphical interface, you must use the vi editor to edit the/etc/network/interfaces file for static IP configuration. However, the setting is unsuccessful, I don't know why, and I have also searched online materials. They are all set up. After Continuous experiments, the configuration is successfully completed, leaving logs for future reference: Use vi and enter the command (in order not to enter sudo, I directly switch to the root account): sudosu
I have installed Ubuntu server before. Because ubuntu server does not have a graphical interface, you must use the vi editor to edit the/etc/network/interfaces file When configuring the static IP address. However, the setting fails, I don't know why, and I have also searched online materials. They are all set up.
After Continuous experiments, the configuration is successfully completed, leaving logs for future reference:
Use vi and enter the command (to avoid entering sudo, I will directly switch to the root account ):
Sudo su
Vi/etc/network/interfaces
The content of the configured file is (marked in red as the added content ):
# This file describes the network interfaces available on your system
# And how to activate them. For more information, see interfaces (5 ).
# The loopback network interface
Auto lo
Iface lo inet loopback
# The primary network interface
Auto eth0
# Iface eth0 inet dhcp
Iface eth0 inet static
Address 192.168.0.6
Netmask 255.255.255.0
Gateway 192.168.0.1
Note that after the configuration is complete, restart the network:
/Etc/init. d/networking restart
If it is not a root account, add sudo.
I set a static IP address yesterday. When I turned on my computer again today, I found that the server could not be connected to the Internet. I wondered if I didn't set DNS, use the vi editor to open/etc/resolv. conf:
Vi/etc/resolv. conf
Add DNS:
Search mydomain.com
Nameserver 61.139.39.73
Nameserver 61.139.2.69
After the configuration is complete, restart the network:
/Etc/init. d/networking restart
Solve the problem!
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2