Ubuntu Configuration Static IP

Source: Internet
Author: User

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

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.