Explain how to set static IP on ubuntu14.04

This article introduces in detail how to use ubuntu14.04 to set a static IP. You can quickly set a static IP without having to modify some SSH links every time. So we will record the method of setting static IP under ubuntu14.04 system.

first step:

Configure a static IP address:

Open the /etc/network/interfaces file, the content is

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

The above means that DHCP is used to allocate IP by default. If you want to specify a static IP, you need to modify the following

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static*******Defined as static IP

address 192.168.2.29*******IP address to be set
netmask 255.255.255.0*******Subnet mask
gateway 192.168.2.1*******Gateway (routing address)

Then save this file

**Step 2: **

Manually set up DNS server

Open the file /etc/resolv.conf and set the content as follows

nameserver 192.168.2.1******Gateway (same as above)
nameserver 202.106.0.20******DNS server address (I found it by referring to other computers linked to this network)

third step:

Note: After restarting Ubuntu, I found that the Internet cannot be accessed. The problem appears in /etc/resolv.conf. After restarting, the dns configured in this file is automatically modified to the default value. So you need to permanently modify the DNS. The method is

Open the file /etc/resolvconf/resolv.conf.d/base and write the following content:

nameserver 192.168.2.1
nameserver 202.106.0.20

the fourth step:

Restart the network service to make it effective, the command is:

/etc/init.d/networking restart

(My personal experience is: restarting this service is invalid, or restarting the system is awesome)

The above is the whole content of this article, I hope it will be helpful to everyone's study.

Recommended Posts

Explain how to set static IP on ubuntu14.04
How to set static IP on Ubuntu 18.04 Server
How to set static IP in ubuntu14.04
How to set a fixed IP based on Ubuntu 16.04
How to set up R on Ubuntu 14.04
How to set PostgreSQL startup on Ubuntu 16.04
ubuntu16.04 set static ip
How to set up Shiny Server on Ubuntu 14.04
Explain how to add swap partition on Ubuntu 16.04
How to set up time synchronization on Ubuntu 18.04
ubuntu 18.04 set static ip method
How to set up a DNS server on Ubuntu 18.04
How to configure a fixed IP based on Ubuntu 18.04
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
How to install MySQL on Ubuntu 20.04
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to install Anaconda3 on Ubuntu 18.04
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04
How to install MemSQL on Ubuntu 14.04
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to upgrade to PHP 7 on Ubuntu 14.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install Python 3.8 on Ubuntu 18.04
How to install KVM on Ubuntu 18.04
How to install KVM on Ubuntu 20.04
How to install opencv3.0.0 on ubuntu14.04
How to install Anaconda on Ubuntu 20.04
How to install Prometheus on Ubuntu 16.04
How to install Jenkins on Ubuntu 18.04
How to deploy Django on Ubuntu 14.04
How to install Apache on Ubuntu 20.04
How to install R on Ubuntu 20.04
How to install Moodle on Ubuntu 16.04
How to install Solr 5.2.1 on Ubuntu 14.04
How to install Teamviewer on Ubuntu 16.04
How to secure Nginx on Ubuntu 14.04
How to install MariaDB on Ubuntu 20.04
How to install Nginx on Ubuntu 20.04
How to install Mono on Ubuntu 20.04
How to install Go on Ubuntu 20.04
How to install Zoom on Ubuntu 20.04
How to uninstall software on Ubuntu
How to install Nginx on Ubuntu 16.04
How to install OpenCV on Ubuntu 20.04
How to install Spotify on Ubuntu 20.04
How to install Postman on Ubuntu 18.04