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.