ubuntu16.0.4 method to set a fixed IP address

Since the ip is easy to change after Ubuntu restarts, the ip address can be fixed in the following way

1. Set ip address

vi /etc/network/interface
# The loopback network interfaceauto lo
iface lo inet loopback
# The primary network interfaceauto ens32
iface ens32 inet static
address 192.168.159.130
netmask 255.255.255.0
gateway 192.168.2.1

2. Set dns

 vi /etc/resolvconf/resolv.conf.d/base
nameserver 8.8.8.8
nameserver 8.8.4.4

3. Refresh configuration file

resolvconf -u

4. Restart network service

/etc/init.d/networking restart

If the above command fails to restart the network card, you can manually turn off the network card, and then open the network card, this is the ip has been changed, it has become the fixed ip you set

to sum up

The above is the method of setting a fixed ip address for ubuntu16.0.4 introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!

Recommended Posts

ubuntu16.0.4 method to set a fixed IP address
How to set a fixed IP based on Ubuntu 16.04
ubuntu 18.04 set static ip method
How to configure a fixed IP based on Ubuntu 18.04
How to set static IP in ubuntu14.04
How to set static IP on Ubuntu 18.04 Server
ubuntu 17.10 set solid IP
Summary of CentOS method to set static IP
How to set static IP on Ubuntu 18.04 Server
Explain how to set static IP on ubuntu14.04
ubuntu20.04 set static ip address (including different versions)
ubuntu16.04 set static ip
How to set up a DNS server on Ubuntu 18.04
Complete steps to configure IP address in Ubuntu 18.04 LTS
Example of how to modify ip address in Ubuntu20.04
How to set up a Masterless Puppet environment on Ubuntu 14.04
How to set up a firewall with UFW on Ubuntu 14.04
How to set up a production Elasticsearch cluster on Ubuntu 14.04
ubuntu modify and configure ip address
ubuntu16.04 method steps to upgrade the kernel
How to set up Gogs on Ubuntu 14.04
Ubuntu17.04 configuration method to replace domestic sources
How to set up R on Ubuntu 14.04
How to set PostgreSQL startup on Ubuntu 16.04
How to set up Shiny Server on Ubuntu 14.04
[Quick Start with Ubuntu] Two, Ubuntu set static IP
Add a new project to SVN under Ubuntu
How to set up time synchronization on Ubuntu 18.04
A few things to do after installing Ubuntu 18.04
How to install Chinese input method on ubuntu
Use the command line to detect the Ubuntu version method
How to set up Ghost one-click app for Ubuntu 16.04
How to start a blog with Hexo on Ubuntu 14.04
A simple tutorial to install Sogou Pinyin on ubuntu18.04
Detailed steps to install Sogou input method on Ubuntu 20.04
How to create a Python virtual environment in Ubuntu 14.04
Many attempts to set up soft routing in ubuntu
How to repair a damaged Ubuntu system without reinstalling