(1) Modify IP
Configuration file/etc/network/interfaces
Add the following statement:
Auto Eth0
Iface eth0 inet Static
Address 192.168.2.86 #IP地址
netmask 255.255.255.0 #子网掩码
Gateway 192.168.2.1 #网关
(2) Modify DNS
Configuration file/etc/resolv.conf
Add the following statement:
NameServer 192.168.2.1 #希望修改成的DNS
NameServer 8.8.8.8
Here is a bit of a problem, is to restart Ubuntu after the discovery and can not surf the internet, the problem is/etc/resolv.conf. Once restarted, the DNS for this file configuration is automatically modified to the default value. So you need to permanently modify DNS. Here's how:
Open/etc/resolvconf/resolv.conf.d/base
Join:
NameServer 192.168.2.1
NameServer 8.8.8.8
(3) The last step of Ubuntu server (not required).
Add this command to restart the network configuration in the rc.local:
sudo/etc/init.d/networking restart
Static IP configuration in Ubuntu server