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