ubuntu14.04 Configuring a static IP address

Source: Internet
Author: User
Tags nameserver

1. Locate the file and make the following changes:
Vim/etc/network/interfaces
Modify the following sections:
# interfaces (5) file used by Ifup (8) and Ifdown (8)
Auto Lo
Iface Lo inet Loopback
Auto Eth0
Iface eth0 inet Static
Address 192.168.108.50
Gateway 192.168.108.2 #netstat-r command or Nm-tool view existing
Netmask 255.255.255.0
#network 192.168.0.0
Broadcast 192.168.108.255 #广播地址, you can view existing ones through ifconfig.
Restart the network after the configuration is complete:
sudo/etc/init.d/networking restart
At this point, the modified configuration information is reviewed.
2. Configure DNS
The next step is to configure DNS resolution, and then/etc/resolv.conf the DNS parsing file.
Execution: vim/etc/resolv.conf
Dnameserver 127.0.1.1
NameServer 223.5.5.5 #阿里的DNS, here I use the source of Ali, can also be modified into other.
NameServer 220.170.64.68 #新添加 Easy Network timeout, affecting internet speed
NameServer 8.8.8.8 #新添加 Easy Network timeout, affecting internet speed
Search Localdomain
Change it, and if it restarts, it will turn out to be the same, so let it change forever, so
Execution: Vim/etc/resolvconf/resolv.conf.d/base
NameServer 223.5.5.5 #阿里的DNS, here I use the source of Ali, can also be modified into other.
NameServer 220.170.64.68 #新添加 Easy Network timeout, affecting internet speed
NameServer 8.8.8.8 #新添加 Easy Network timeout, affecting internet speed
Then save the exit, to the basic is completed, and then still can not connect to the Internet, to the/etc/networkmanager/directory system-connections deleted, or moved to another directory.
[Email protected]:/home/zhaofuxin# ifdown eth0
[Email protected]:/home/zhaofuxin# ifup eth0

If you are still unable to surf the Internet, restart the machine. Problem solving. Test to view several Web pages, no problem (although the desktop status bar of the network icon is not connected, but does not affect the Internet).

ubuntu14.04 Configuring a static IP address

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.