Explain how to set static IP on ubuntu14.04

This note records how to configure ubuntu's static IP

First configure the /etc/network/interfaces file, set the static IP address, gateway, subnet mask and other information

sudo vim /etc/network/interfaces

Add the following content, modify the specific value according to the current network

auto eth0
iface eth0 inet static
address 192.168.124.79
netmask 255.255.255.0
gateway 192.168.124.255
broadcast 192.168.124.255	#广播IP地址

Save file information


Then, manually configure the DNS server.
In the /etc/resolv.conf file, add the following:

nameserver 192.168.124.1	#网关
nameserver 114.114.114.114	#DNS服务器地址
sudo reboot

After saving the file information and restarting the system, the file is automatically modified to the default value, so you need to permanently modify the DNS. The method is as follows:
open /etc/resolvconf/resolv.conf.d/base and add the following content:

nameserver 192.168.124.1
nameserver 114.114.114.114

Restart networking services:

sudo /etc/init.d/networking restart

If the network has not changed, just restart the system.


ubuntu14.04 environment configuration 190325

Guess you like

Origin blog.csdn.net/weixin_43640306/article/details/88806774