Ubuntu 15.10 Set static IP assignment fixed IP settings DNS settings Gateway command line Configure IP fixed IP what to do

Source: Internet
Author: User

Files to use:

Configuring interface Information

/etc/network/interfaces

Configuration content:

Auto Eth0

Iface eth0 inet Static

Address 192.168.216.188

Gateway 192.168.216.2

Netmask 255.255.255.0

Configure DNS

/etc/resolvconf/resolv.conf.d/base

Configuration content: NameServer 192.168.216.2

To view DNS:

/etc/resolv.conf

Command:

View System Network Information

Ifconfig

Restart Network Service

/etc/init.d/networking restart

Take a look at your own local information (auxiliary only)

Available IP

Now automatically assign the ip192.168.216.130

The Mask is 255.255.255.0

In this line starting with 0.0.0.0, his gateway is the default

View DNS

Cat/etc/resolv.conf

So we can find a range of available IP addresses.

:

Gateway

Mask

Dns

It turns out that our NIC is an auto-assigned IP

Modify the following to read:

Auto Eth0

#iface eth0 inet DHCP

Iface eth0 inet Static

Address 192.168.216.188

Gateway 192.168.216.2

Netmask 255.255.255.0

#是注释的意思

Address is IP, please ping before selecting, to see if it can be ping, if not, the description is available

Gateway and netmask based on what we got above.

Note: If static IP information is configured, you cannot surf the Internet, first verify that DNS is configured, and that it is configured correctly

You also need to configure DNS

See the notes for this place?

This file is actually generated automatically, equivalent to a connection, not a real file

Even if you modify this place, after restarting, DNS will disappear again, you can try

It's actually pointing to this file.

We just need to fill in this place with our DNS.

It won't disappear after the reboot.

In addition, we can also

Add this inside:

Dns-nameservers xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx

The way to add

So now our interfaces is

DNS is configured as:

Set up, restart the service

/etc/init.d/networking restart

Requires root user rights

Restart Ubuntu if it's not in effect

The mutual ping is all through.

And you can surf the Internet, too.

Ubuntu 15.10 Set static IP assignment fixed IP settings DNS settings Gateway command line Configure IP fixed IP what to do

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.