Ubuntu Configuration Static IP
Static IP configuration
Ubuntu Network configuration information is placed in the /etc/network/interfaces If the configuration dynamically gets the IP , add the following to the above file:
Open the network configuration information file using the following command:
sudo gedit/etc/network/interfaces
Edit the file (pay attention to prosecuting your Getway is correct. ):
Auto Eth0
Iface eth0 inet Static
Address 192.168.8.119
Netmask 255.255.255.0
Gateway 192.168.8.1
Restart the network after the configuration is complete:
sudo/etc/init.d/networking restart
or Service Network-manager Restart
At this point, the modified configuration information is reviewed.
Configure DNS
directly in /etc/resolv.conf add dns , after restarting, the file will be rewritten, the original configuration of the dns /etc/resolvconf/resolv.conf.d/ Create a new tail file, fill in the required dns server can resolve this issue.
in the /etc/resolvconf/resolv.conf.d/ Create a new directory under Tail File:
sudo vi/etc/resolvconf/resolv.conf.d/tail
enter in the file DNS :
' NameServer 223.5.5.5 ' # Ali's DNS, here I use the source of Ali, can also be modified into other.
Save.
Solve the internet can not
1, add the public network DNS
If you cannot check the configuration NDS on the Internet, if DNS is configured for your own company's internal DNS,
Suggested additions:
114.114.114.114 is the domestic mobile, telecommunications and Unicom Universal DNS
8.8.8.8 Google DNS
223.5.5.5 Ali Public DNS
or choose your familiar and useful DNS add one, no need to add
Restart the NIC.
Service Network-manager Restart
or sudo ifdown eth0; sudo ifup eth0
2. Configure the default route
# route Add default GW xxx.xxx.xxx.xxx ( IP for Gateway )
Here is temporarily add default route, restart invalid, if you want to refer to my other blog "ubuntu configuration static Routing and restart effective"
This article from the "Operation and maintenance of small Masters" blog, reproduced please contact the author!
Ubuntu Configuration Static IP