- Skip to primary navigation
- Skip to main content
- Skip to primary sidebar
- Skip to footer
Your Friendly Hosting Provider

- Domain name
- Domain extensions
- Webhosting Solutions
- Webhosting Complete
- WordPress Webhosting
- WooCommerce Webhosting
- Reseller Hosting
- Managed Cloud VPS
- Managed Pure Performance VPS
- Managed Azure VPS
- Managed Dedicated Servers
- Pure Performance VPS
- Enterprise Dedicated Servers
- Budget Dedicated Servers
- Server Upgrades
- Add-on Solutions
- Operating Systems
- Microsoft 365
- Support Portal

Snel Status
- Contact Support
- Write for Snel.com
- Free Moving service
- Data Center
- Payment Methods
- Monthly terminable
- ISO 27001 Certified
- Service Level Agreement
- Affiliate Program
- Static IP Configuration on Ubuntu 16.04
Introduction
There are two methods to assign network configuration to a device on the net. DHCP or static assignment. DHCP is normally set as default. Static configurations usually need IP addresses as well as DNS resolvers plus routing. In this tutorial, we will cover Linux static configuration on Ubuntu 16.04.
Prerequisites
- Cloud VPS or Dedicated Server with Ubuntu 16.04 installed.
- You must be logged in via SSH as sudo or root user. This tutorial assumes that you are logged in as a sudo user.
Step 1: Log in using SSH
You must be logged in via SSH as sudo or root user. Please read this article for instructions if you don’t know how to connect.
Step 2: Find the active network interface
Step 3: configure the network interface.
In our example, our network interface is ens18 with the following network details:
Our article will use network interface ens18 and the server details described above. Your server details will not be the same as our article and your network interface name can be different then we use in our article. Use the network interface name you get from step 2.
Edit your network configuration file
It should be similairto this configuration
Replace the above two lines to use statc IPv4 instead of DHCP
Apply the changes
Congratulations, you have now configured a static IPv4 for your Ubuntu 16.04 Operating System. If you need to configure static IPv6 for your Ubuntu 16.04 use this article .
Reader Interactions
Tuesday, August 20th, 2019 at 21:11
not clear. you say to remove dhcp line but you still have it in your example. Can you show an final version of the file?
Tuesday, August 20th, 2019 at 23:05
We will update this article ASAP. In the meantime, you can use our other article which has a working static IPv4 configuration https://www.snel.com/support/how-to-add-ipv6-on-ubuntu-16-04/
Monday, August 26th, 2019 at 15:33
Article is updated
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *

Deploy your Cloud VPS within 2 minutes
Become a Snel.com customer today

Our Products
More….
- ISO 27001 Certification
- Privacy Statement
- Terms and Conditions
- Data Processing Agreement
- Acceptable Usage Policy
- Looking for a Webdeveloper?
- Choosing between a Managed vs Self-managed Server
- NVMe, SSD of HDD server?
- Sharing your company on Google Maps
- White label reseller hosting: Start your own brand
Copyright © 2023 Snel.com B.V. All Rights Reserved.
Michael McKinnon – People | Technology | Cyber Security
People bring purpose, Technology is the tool, Life should be secure.

Configure static IP address on Ubuntu 16.04 LTS Server
Ubuntu 16.04 has been out for just over a month now, and I’m in the process of upgrading some boxen. In some cases I’ve been completely reinstalling them for that clean fresh feel, and find myself once again having to configure static IP addresses.
Doing this can be problematic (made worse by the fact that even the official Ubuntu LTS documentation doesn’t give correct advice), particularly when it comes to DNS resolution, and in my case, a very-old-school habit of blindly wanting to edit the /etc/resolv.conf file which you really should not be doing any more these days.
Step 1. Edit the /network/interfaces file

In this case, look for the line in the file that says “# The primary network interface” and directly beneath this you’ll see something like ( the default DHCP configuration ):
If you’ve been using previous versions of Ubuntu you might have noticed that the interface name above “ens160” looks a bit odd. It used to be called “eth0” or “eth1”, but as from Ubuntu 15.10 the interface name is now allocated based on a few other factors – read more about that here if you’re interested .
Simply comment, remove or edit the line that says ends with “dhcp” and add the following information ( here’s an example only ):
Next you’ll want to add the nameservers by adding the line “dns-nameservers” followed by a list of IP addresses. A lot of people use Google’s public DNS, or if you have details from your service provide use them instead.
PRO-TIP: Double-check the file again, and ensure all details are correct, before proceeding. If you are configuring a remote system you could easily cut yourself off if you get it wrong.
Save the file, and you’re done.
Step 2. Restart the networking service (or reboot)
Once you are confident the change has been made, and if you don’t want to reboot you can just restart the networking service.
After doing this, and provided you don’t get any errors, your primary network interface should now be configured with the static IP address details you have provided.
Failing that, a reboot will also do the trick quite nicely, and with the current version of 16.04 I suspect there’s a bug that is causing “ifconfig -a” not to update unless you perform a reset.
Good luck, and may your boxen be correctly addressed.
16.04 , interfaces , networking , static ip , ubuntu , xenial
Share this:
Michael McKinnon View All
31 thoughts on “ configure static ip address on ubuntu 16.04 lts server ” leave a comment ›.
yo lo uso asi
iface em1 inet static address 192.168.1.10 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1 dns-nameservers 200.72.1.5
Excuse me in 16.4 I under/etc/network/interfaces configured in the static IP, I again using ifconfig IP display is another IP.In interfaces configured to complete is invalid, what reason is this
Thanks for the g8 article . Surprisingly I don’t have iface ens160 inet dhcp inside this path etc/network/interfaces. I have 16.04 ubuntu.
Thank you 🙂
The “ens160” reference for the Ethernet interface can vary from system to system, so just substitute with whatever you have.
It’s the oddest thing. If I edit the network adapters config file using a the CLI or SSH it does not work and I lose all network connectivity, the interface actually disappears. If I install a GUI and Sudo edit the file (open terminal in the GUI, type ‘sudo nautilus’ then browse to the file’s location and edit) it works. I scrapped 4 VMs before finding this “recipe.” Weird or what?
After following this “helpful guide” my adapter has disappeared as well. Made all my changes via the command line as well.
Should not need gui tools to edit this file! What the hell did the Ubuntu Team do? Good Grief!!!
OK Googled the fix: Don’t delete the “auto enpwtf” line above the iface line or your network adapter will disappear!
Thanks for that! Super helpful – server working great now.
I tried to restart networking by doing but the old DHCP address persisted. Rebooting gave me the new static address however. Is “service” deprecated? If so, invoking it silently does nothing – no diagnostic.
Yes “service” isn’t the right thing to use anymore, you could also try this:
sudo systemctl restart NetworkManager.service
Concise and informative. Worked for me. Thank you.
Thank you worked perfectly
I followed these steps but still gets host unreachable anytime I ping using the configured IP address to see my ubuntu server can be reached. Please help
Thanks.. very helpful
- Pingback: Class 2: Ubuntu 16.04 LTS – LAMP Server Install and Security Basics | Code Sport I/O
For those who have experimented problems with Ubuntu 16.04 LTS (networking service restart didn’t work):
ip addr flush ens160 && ifdown ens160 && ifup ens160
That did the trick for me 😉
Hi, In my /etc/network/interfaces, I didn’t see any ethernet-like interface. Look:
[email protected]:/etc/network# ifconfig enp0s31f6 Link encap:Ethernet HWaddr 70:4d:7b:88:e6:7c inet addr:192.168.2.150 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::fab5:dec9:7bfd:af07/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:24031 errors:0 dropped:0 overruns:0 frame:0 TX packets:22581 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:32890636 (32.8 MB) TX bytes:1825913 (1.8 MB) Interrupt:16 Memory:f7300000-f7320000
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:494 errors:0 dropped:0 overruns:0 frame:0 TX packets:494 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:38600 (38.6 KB) TX bytes:38600 (38.6 KB)
[email protected]:/etc/network# [email protected]:/etc/network# [email protected]:/etc/network# cat interfaces # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback [email protected]:/etc/network#
Can you help to tell me how to configure it to be static ip? Thanks!
thanks Michael McKinnon, i want to run my Ubuntu 16.04 from two IP address 192.168.1.104 and 192.168.1.105
please give me any suggestion.
Hi there, sorry for the delay in responding.
To achieve this you can simply repeat the “iface inet static” section for the second address you wish to add in the /etc/network/interfaces file.
Alternatively if you just wanted to add a second IP address (known as an alias) temporarily while the system is running it’s also very easy to do something like “sudo ifconfig eth0:1 192.168.1.105” – this will create a new “alias” interface called eth0:1 (the :1 addon indicates this) – and to turn it off “sudo ifconfig eth0:1 down”.
If you’re not sure what interfaces the system has use “ifconfig -a” for a full list, or “ifconfig -s” for a short list.
Thanks Michael,
the “sudo ifconfig enp2s2:1 192.168.1.121” is working fine for me
but the below code in /etc/network/interfaces is not working. i am using Ubuntu 16.04
auto lo enp2s2 iface lo inet loopback iface enp2s2 inet static address 192.168.1.102 netmask 255.255.255.0 gateway 192.168.1.255
iface enp2s2:1 inet static address 192.168.1.121 netmask 255.255.255.0 gateway 192.168.1.255
At the top of your interfaces file modify the “auto lo enp2s2” line to read “auto lo enp2s2 enp2s2:1” – this tells the network configuration which interfaces to bring up at boot time.
On freshly installed 16.04.5 I lost a good hour before realizing I had to rem out _both_ of the first 2 lines. I don’t know if I accidentally deleted the 2nd “#” or if it was never there. This issue appears to only interfere with static IP assignment, not DHCP.
ditto – it was never there(!)
This is very helpful
- Pingback: Installing Kubernetes cluster using Windows Server nodes – Datacenter Rookie
THANKS. THIS IS VERY HELPFUL
Thank you, I’m glad it helped 🙂
- Pingback: Server Bug Fix: How to add IPV4 range to unmanaged server - TECHPRPR
brother i put primary network interface ip and am not able to ping and open in web console first i was not able to login with root user then i tried sudo su and make it super user i want to load zabbix
I had to change the IP address in the /etc/hosts file as well
- Pingback: How to add IPV4 range to unmanaged server - Boot Panic
Leave a Reply Cancel Reply
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Notify me of new posts via email.
This site uses Akismet to reduce spam. Learn how your comment data is processed .

- Already have a WordPress.com account? Log in now.
- Follow Following
- Copy shortlink
- Report this content
- View post in Reader
- Manage subscriptions
- Collapse this bar
How to set static IP Address in Ubuntu Server 16.04
It is really important to know how to configure static IP Address on Ubuntu Server, Because it is almost impossible to run a server without a static IP Address.
During the installation, Ubuntu Server by default configured to use dynamic IP Address. In this Tutorial we are going to learn how to set static IP Address in Ubuntu Server 16.04.
Following are the steps we are going to follow
- Check Available network interfaces on Ubuntu Server 16.04
- Add static IP Configuration to the network configuration file.
- Restart Ubuntu Networking Service.
Check Available Network Interfaces on Ubuntu Server
First of all you need to get the list of available network interfaces on your Ubuntu Server 16.04. We can use ip link show command to find available network interfaces on Ubuntu Linux.
ip link show
You should get the similar output as below screenshot shows.

As above image shows, Our Ubuntu Server has Ethernet interfaces called enp0s3. Next we'll set static IP address to the enp0s3 interface.
Set static IP Address to the network interface
For this example I am going configure enp0s3 Ethernet interfaces with following ip configuration
IP Address = 192.168.1.10
Network mask = 255.255.255.0
Default gateway = 192.168.1.1
DNS Server = 8.8.8.8 and 8.8.4.4
On Ubuntu server, in order to set static IP address we need to add IP configuration to the /etc/network/interfaces file. So open the /etc/network/interfaces file using a command line text editor (You can use vim or nano on Ubuntu Server).
vim /etc/network/interfaces
Then set static IP address as follows.
First line of configuration should be the word "auto" followed by the interface name (This brought up the network interface automatically when system boot or when networking restart).
auto enp0s3
The next line should specify whether to use static IP address or dhcp ip on the enp0s3 network interface. In our case it should be static.
iface enp0s3 inet static
Then add the static IP configuration as follows.
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
Restart Networking Service
After setting up IP Configuration, we need to restart Ubuntu networking service.
sudo ip addr flush enp0s3 && sudo systemctl restart networking.service
Verify the static IP configuration.
After restarting network, use ip add command to make sure that static ip address has been assigned to the network interface.

Then send ICMP request to a remote host to check the connectivity.
ping -c 4 google.com

Configure Multiple Network Interfaces
Same Way you can configure multiple network interface on ubuntu server using /etc/network/interfaces file.
In the following example, I have set static IP Address on two network interfaces (enp0s3 and enp0s8).
auto enp0s8
iface enp0s8 inet static
address 192.168.0.100
*** Most important thing when configuring multiple interface is you cannot set multiple default gateways. Only one interface should configure with the default gateway. For other interfaces you should add default gateway using static routes.
Summary : Set Static IP Ubuntu Server 16.04
In this tutorial we learned how to set static ip address in Ubuntu server 16.04.
- Using ip link show command we identified the available network interface in our ubuntu server 16.04.
- Then we add static IP address configuration to the /etc/network/interfaces file and restart the ubuntu networking service.
Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.

How do I set a static IP in Ubuntu?
I am a new with Linux, having years experience with Windows servers/desktops and am having issues setting a static IP. I am using a method used for previous versions of Ubuntu, which doesn't seem to work with 16.04
I have used the command sudo nano /etc/network/interface and added the following
I have rebooted the system and the Ethernet is pretty much dead, ping doesn't work at all. I have tried to modify /etc/NetworkManager/NetworkManager.conf and made the following changes
With this I can get Ethernet to work sporadically, however it eventually fails.
I have tried this configuration on two other machines plus a virtual machine as well and all have the same results. I can confirm these settings work fine when I install Windows on any of these machines. As well when I let DHCP auto configure, everything works fine no issues.
I figure I am missing something here, setting up a static IP should not be difficult at all.
- network-manager

- the only thing I notice and it may have just been a typo here but I would change the Dns-nameservers to dns-nameservers probably not going to do anything to solve this issue but may stop other issues from happening – John Orion May 2, 2016 at 0:20
- 1 Dns-nameservers is acceptable syntax wise so it shouldn't be an issue. When it was working with DHCP, did you run an ifconfig to check the interface name or did you assume it was enp0s25? Also do you have an auto enp0s25 at the top of your config file? If you don't its possible that the interface is just not coming up on boot. – Andrew May 2, 2016 at 0:30
- Please edit your question and post the exact content of your /etc/network/interfaces file. While editing your message, highlight the text of this file, then click on the {} code link on the top of the message editor so that it will properly format the text making it easier for us to read the content. Also do execute this command ip address and perform the same steps to {} (code format) that output. – L. D. James May 2, 2016 at 4:05
9 Answers 9
I had the same problem and this was my solution:
and paste (altering for your network) this under # The primary network interface :
You can get correct interface name using Terminal command ifconfig -a on ubuntu 16.04 or ip address on 18.04+
Shutdown your Virtual Machine and then!!! Go to network settings and click on refresh MAC address button a few times :)

and start your VM and you should get internet!
UPDATE 20.02.2019
For ubuntu 18.04+ you need to edit this file
- 2 Great thanks I appreciate it. It seems to work now, with no problems. It is very solid right now! – TeeStar May 7, 2016 at 2:07
- In addition to the dns-nameservers fix, I had to use this fix: askubuntu.com/questions/574569/… My ISP is monkeybrains.net. – BSalita Aug 22, 2016 at 23:38
- does not work in my VMWare player with ubuntu16.04 – ZhaoGang Mar 8, 2021 at 6:26
- I suppose you didn't configure the network properly in VM-Ware Player.... but your bigger problem is: Why do you still use Ubuntu 16.04... The support is "end of life"... – lewis4u Mar 8, 2021 at 7:33
Setting the static IP address as above in the accepted answer here works, but one has to flush the old IP addr setting and then restart networking.service:
Then verify it is correct:
- 2 The flush was necessary to avoid the old address being present on the interface (based on ip addr ). The systemctl restart works too, though ifdown and ifup on the interface will work more selectively. – RichVel Nov 28, 2016 at 13:28
- 2 thx @Grant. adding flush made this work – Paweł Madej Feb 1, 2017 at 13:19
- 3 In Ubuntu 16.04 and newer flush is necessary! – Diego Duarte May 2, 2017 at 12:05

- 1 ifcace should be iface on line 5 – twoleggedhorse Jun 28, 2017 at 14:33
- @twoleggedhorse: Fixed the typo for the answer but I had to add a few # in the first line because you cannot have an edit without at least 6 changed characters that are not whitespace – Andrei Rînea Nov 28, 2017 at 17:11
sudo vim /etc/network/interfaces
sudo ifdown eth0 && sudo ifup eth0
- 10 Hi @lanni654321, maybe you should edit your answer and add a few word, briefly explaining what you are doing and why? i think that would make your answer even more helpful, what do you think? – Tshilidzi Mudau Oct 14, 2016 at 6:58
I had the same problem and the solution "was" simply... for me, at least.
And, create an empty file with the name of the network interface in:
It works...
I had the same problem and this was my solution: Remove all empty lines at the end of the file /etc/network/interface .

If your server is showing that old IP as well as new assigned IP, simply restart your server. It will automatically flush old IP and persist the new one. And if you don't want to restart your server, use this command:
sudo ip addr flush <your-interface-here>
Run this simple commands to see if your network interface(s) are set to come up when the machine boots / restarts.
If no lines are printed to standard output, then open /etc/network/interfaces with a text editor (vi, nano, sed) and hopefully you will see something similar to the image below below.

Obviously, if grep did not return any lines to the terminal window, the format of your /etc/network/interfaces cannot be very similar at all. :-) However, follow the format of the auto lines.
====================
Now, on your machine .
Don't know which interface names are available? Run this command.
The following command will return just the names of the network interfaces.

I used to set static IPs on my Ubuntu machines and then I noticed that I can just assign the IP address using my router. This may be the simplest solution. Just log in to your router, find the attached devices, and assign the IP address there.
Your Answer
Sign up or log in, post as a guest.
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service , privacy policy and cookie policy
Not the answer you're looking for? Browse other questions tagged networking network-manager dns dhcp ip or ask your own question .
- The Overflow Blog
- Building an API is half the battle: Q&A with Marco Palladino from Kong
- Developers think AI assistants will be everywhere, but aren’t sure how to...
- Featured on Meta
- We've added a "Necessary cookies only" option to the cookie consent popup
- The Stack Exchange reputation system: What's working? What's not?
- Announcement: AI-generated content is now permanently banned on Ask Ubuntu
Hot Network Questions
- How were rackmount workstations wired-up to mice, keyboards, monitors, etc?
- How to duplicate texture node without duplicating its settings?
- If electric field inside a conductor is always zero, then why do free electrons move?
- How would you represent the T-gate in terms of X-gate and Y-gate? So rotations around the X and Y axis
- Theoretical Computer Science vs other Sciences?
- Could a 1-2 foot tall (30-60 cm tall) human fly with giant artificial insect wings attached to their back?
- Clarifications on the Eversmoking Bottle 5e
- Why is it an unpopular view that a human being has a supernatural, spiritual soul?
- Why are most US news programs silent about Iran-Saudi deal announced at Beijing on March 10th?
- Is post-hyphenation necessary in "I am a child and adult psychologist..."?
- Why does potassium bifluoride exist whereas bichloride does not?
- How do you use unreliable narration when using an omnipotent narrator?
- A melody is built from both notes and chords
- what is the meaning of "系" in below sentence?
- Should a device with a non-polarized plug touching hot and ground trip a breaker?
- Is there a way to use Stockfish to see tactics that aren't necessarily great?
- What does the following excerpt from "To Kill a Mockingbird" mean?
- Most polyominoes in an 8x8 grid
- What does 'encore' mean in this sentence?
- How to weight a list of ranks by a numeric value by individual in R
- Would it be possible for a planet to orbit around a trinary star system in a figure 8 orbit?
- Is there a RAW or optional rule for how a player could discover what type of skill check needs to be made?
- What does "investing in credit" mean?
- Truncated floor symbol
Your privacy
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy .
Set a static IP address on an Ubuntu 16 or older system
These instructions are for Ubuntu 16 and older. If you have another operating system, please consult documentation to learn how to adjust those to a static IP address.
Please note that this guide does not allow you to just arbitrarily set any public IP address on the Internet, you can't just pick and choose an IP address on the Internet. It has to be assigned to you by your service provider and has to be available for use before you can use it. And on cloud environments, generally you are not supposed to touch the operating system network configuration at all, since attaching and assigning a public IP address is generally handled in the cloud management web portal, and not in the OS itself, in most cases. But for deployments on a local network or a private network, and you need to set a static IP for the operating system that runs the Access Server software, this guide will be useful.
We also assume that you do not use the Ubuntu program NetworkManager. If you do, and you have a GUI on your server, you may want to instead do it via the GUI. But if you have a headless server running on a physical server, or on HyperV, ESXi, and so on, you can use this guide to set a static IP address. The process is relatively straightforward, there is a text file that contains the configuration for your network interfaces. Adjust it to look like the sample below and adjust the addresses to match your network and your desired static IP. We assume an IPv4 address because at the moment this documentation section was written the Access Server only supported incoming OpenVPN tunnel connections on IPv4.
Changing the network interface settings could mean you lose network access to this system if you make a mistake. So be aware of this and either beforehand make a backup of your Access Server settings or make a snapshot if possible in your hypervisor or cloud environment, or see if can get access to the (virtual) console to make corrections afterwards.
It is also important to note that if you have a DHCP server in your network you can also choose to use the DHCP reservation option there (if present) to always assign the same DHCP IP address to this server. But not all DHCP servers have this option. In such a case you can still do the static IP address assignment in the Linux server operating system itself with the instructions below, but please then do not configure the static IP to one inside of the DHCP range, but outside of it. Otherwise the DHCP server may consider the IP address you have chosen for your server suitable for assignment to a DHCP client, and that can cause an IP address conflict. Some networks have no DHCP server at all, and in that case you can pick any free IP you want with the instructions below.
Open the file /etc/network/interfaces in the nano text editor:
If you see in the contents of that file a message like "ifupdown has been replaced by netplan on this system, see /etc/netplan for current configuration" then your system is apparently using netplan for configuration instead. We have another guide to cover that type of configuration and you should then instead use this guide:
- Instructions on how to set a static IP address on Ubuntu 18 or newer
Example contents of the interfaces file:
Press ctrl+x, then press y, and then press enter, to save and exit the file. You should reboot to allow the changes to take effect.
In the example above, the IP address is set to 192.168.70.2 and it is in the 192.168.70.0/24 network with an Internet gateway and DNS server at 192.168.70.254 . In some situations if the DNS server needs to be changed and you have things set statically you’ll need to edit /etc/resolv.conf and update it to have the correct DNS server. Without a working DNS server you’ll be able to ping IP addresses like 8.8.8.8 on the Internet, but not be able to resolve and ping addresses like www.openvpn.net. In the resolv.conf file you can fix that. Another important thing to note here is that in our situation shown above we have only one network interface and it is called ens192 . If it is called something else in your system, obviously make allowances for this and adjust things as necessary.
If you have successfully changed the IP address, and you can gain access via SSH to the server, but the Access Server web services are not responding, it is possible you had your Access Server configured to listen to a very specific IP address, and if you have changed this, then the Access Server web services won’t start. We have a guide to reset the web services and daemon ports here to resolve that issue.
Updates & Announcements
CloudConnexa™
Cyber Shield Released
Learn More
Access Server
Release Notes 2.11.3
Read Release Notes
Setting a static IP address in Ubuntu 16.04 vs 18.04 LTS
Static IP addresses are an important part of networking for many types of servers, although a bit more overhead to configure they ensure a consistent state. The Ubuntu configuration of static addresses varies depending on the operating system version you are running, this guide will look at the 2 most recent versions with Long Term Support (LTS)
This guide shows you how to configure a static IP address on an Ubuntu server running 16.04 LTS or 18.04 LTS that is currently configured with DHCP.
Assuming your Ubuntu server is connected to the network on DHCP, to verify this run
This should return the interface along with the IP address and subnet issued by DHCP.
To find the gateway address run
Configuring a static IP using the network interfaces configuration file (16.04 LTS)
To set a static address, edit the following file,
If you are presented with the following below, please see the section below titled "Configuring a static IP using Netplan"
# ifupdown has been replaced by netplan(5) on this system. See # /etc/netplan for current configuration. # To re-enable ifupdown on this system, you can run: # sudo apt install ifupdown
Change the file from the DHCP configuration which will look similar to below (Do not change the loopback settings)
# The primary network interface auto ens160 iface ens160 inet dynamic
to the static configuration as per your requirements, i.e.
Exit vi with ESC the :wq! and enter
Reboot and reconnect on new IP to ensure changes have applied correctly.
Configuring a static IP using Netplan (18.04 LTS)
Starting from Ubuntu 18.04 LTS, Ubuntu uses Netplan to configure network interfaces by default. Netplan is a YAML based configuration system, which is designed to simplify the configuration process.
Check for the netplan yaml filename using
Once you have the filename, edit this file using
This should be set similar to the DHCP config as following;
Edit the file so it looks similar to the following;
Apply the yaml configuration
Verify with ifconfig that the changes have come into effect and ensure you can ping a device outside of the local subnet
- View source
- View history
- Download as PDF
Setting up a Static IP address on a Ubuntu 16.04 PC
- 1 Introduction
- 2.1 Step 1: Search
- 2.2 Step 2: System Settings
- 2.3 Step 3: Network
- 2.4 Step 4: Ethernet connection settings
- 2.5 Step 5: Specifying an IP address
- 2.6 Step 6: additional notes
Introduction
This article provides a short guide on how to configure a Static IP address on a PC that uses a Ubuntu 16.04 Operating System (OS). A Static IP configuration on a PC may be required when:
- Upgrading the router's Bootloader version ( Bootloader upgrade guide )
- Upgrading the router's Firmware via the Bootloader menu ( Firmware upgrade via the Bootloader menu guide )
- You lose access to your router's LAN network (for example, when configuring Mobile Passthrough mode, Mobile Bridge mode, when you accidentally disable the router's DHCP server, etc.)
- You're trying to connect to another device that has a Static IP address (for example, an IP camera)
Or any other case that you may think of.
The instruction below are aimed to be applied and used with the Ubuntu 16.04 Operating System (OS), although the configuration is quite similar on other versions of Ubuntu and Linux.
Step 1: Search
First, go to the System Settings menu. To reach it, type in "System Settings" in Ubuntu's search field located in the top left-hand corner of the screen. Click on the "System Settings" icon in the search results field:

Step 2: System Settings
When in the System Settings window, click the Network icon located under "Hardware":

Step 3: Network
Next, in the Network window, select the Network connection (interface) associated with the Ethernet adapter that you wish to set up the Static IP for and click Options :

Step 4: Ethernet connection settings
Next, click on IPv4 Settings and select Manual from the Method drop down list.

Step 5: Specifying an IP address
Finally, click the Add button and enter a Static IP for your PC and other required information:
- Address - e.g., 192.168.1.2
- Netmask - 24 (24 means a 24-bit long netmask, which is the equivalent to 255.255.255.0. You can find more information on Netmasks here )
- Gateway - 192.168.1.1 (router's default IP address):

Step 6: additional notes
- Note 1 : once you are done with your configurations (the reason you needed a Static IP), you should undo the changes that you made to the computer's IPv4 configuration, because otherwise you might not have an Internet connection. To undo these changes, go back to the Editing Ehternet connection and set the Method to Automatic (DHCP)
- Note 2 : if you are planning on using this configuration permanently and will require access to the Internet, add some DNS Servers in to the IPv4 configuration in Step 5
- Note 3 : if at some point your router's LAN IP address was changed from its default value (192.168.1.1) or if you are using this set up in order to connect to another device (an IP camera, for example), make sure to specify a different Default Gateway in Step 5 accordingly. i.e., if the router's address was changed, make sure to specify the current LAN IP address of the router. If you're connecting to another device (e.g., camera), specify that device's IP address.
If your PC runs on a Windows OS, you may want check out our guide on setting up a Static IP address on a Windows 10 system .
Navigation menu
Personal tools.
- Create account
- Recent changes
- Random page
- What links here
- Upload file
- This page was last edited on 9 June 2020, at 07:37.
- Disclaimers
- Mobile view
- Product change notifications

IMAGES
VIDEO
COMMENTS
Static IP Configuration on Ubuntu 16.04 · Prerequisites · Step 1: Log in using SSH · Step 2: Find the active network interface · Step 3: Configure the network
Configure static IP address on Ubuntu 16.04 LTS Server · Step 1. Edit the /network/interfaces file · Step 2. Restart the networking service (or
On Ubuntu server, in order to set static IP address we need to add IP configuration to the /etc/network/interfaces file. · First line of configuration should be
You can get correct interface name using Terminal command ifconfig -a on ubuntu 16.04 or ip address on 18.04+.
The process is relatively straightforward, there is a text file that contains the configuration for your network interfaces. Adjust it to look like the sample
In this video you are going to learn how set a static IP Address on Ubuntu 16.04 and earlier versions.
How to Setup a Static IP Address on Ubuntu 16.04 LTS using /etc/network/interfaces file. We'll setup a Static IP address successfully on
Configuring a static IP using the network interfaces configuration file (16.04 LTS) ... # /etc/netplan for current configuration. ... to the static configuration as
Setting up a Static IP address on a Ubuntu 16.04 PC · 1 Introduction · 2 Set up. 2.1 Step 1: Search; 2.2 Step 2: System Settings; 2.3 Step 3: Network; 2.4 Step 4:
Static IP address assignment ... To configure your system to use static address assignment, create a netplan configuration in the file /etc/netplan/99_config.yaml