Ubuntu 15.10 sets static ip Address Allocation fixed ip Address Settings dns settings gateway command line configuration ip fixed ip address does not take effect what to do, ubuntu15.10

Source: Internet
Author: User

Ubuntu 15.10 sets static ip Address Allocation fixed ip Address Settings dns settings gateway command line configuration ip fixed ip address does not take effect what to do, ubuntu15.10

Files to be used:

Configure 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

View dns:

/Etc/resolv. conf

Command:

View System Network Information

Ifconfig

Restart NETWORK SERVICE

/Etc/init. d/networking restart

View information about your local machine (Auxiliary)

Available IP addresses

The automatically assigned ip192.168.216.130

Mask is 255.255.255.0

In this line starting with 0.0.0.0, its gateway is the default gateway.

View dns

Cat/etc/resolv. conf

In this way, we find an available IP address range.

:

Gateway

Mask

DNS

In the past, our NICs were automatically assigned ip addresses.

Modify to the following content:

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

# Indicates the meaning of the comment.

Address is an IP address. ping the IP address to check whether the IP address can be pinged.

The gateway and netmask can be obtained based on the above.

Note: If the static IP address cannot be accessed after it is configured, check whether the dns is configured and whether the configuration is correct.

You also need to configure dns

Have you seen the comments for this place?

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

Even if you modify this location, the dns will disappear after the restart. You can try again.

It actually points to this file.

We just need to enter our dns in this place.

It will not disappear after restart

In addition, we can

Add:

Dns-nameservers xxx. xxx

Method to add

Now our interfaces is

Dns Configuration:

Set and restart the service.

/Etc/init. d/networking restart

Root User permission required

Restart ubuntu if it does not take effect.

 

Ping each other.

 

Besides, you can access the Internet.

Related Article

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.