WHAT IS STATIC IP ADDRESS ? HOW TO CONFIGURE STATIC IP ADDRESS IN UBUNTU 16.04
In this article we are going to learn How to configure static IP address in Ubuntu 16.04. Before start the configuration let’s understand what is Static IP address. There are two ways by which we can configure IP address. One is Static IP address and another one is Dynamic IP address. When we manually configure the IP address for any network device is called as Static IP address and when DHCP Server assigns IP address to network devices automatically is called as Dynamic IP address. Normally we assign’s Static IP address to network devices like Router, Switch, to any Server, Network printer and so on.
Follow the below steps to configure static ip address in Ubuntu 16.04
There are two method’s by which we can configure Static IP address and both methods are simple to follow. Here in this article I will explain both methods. So let’s get started.
Method : 1
First to check your available network interfaces use the below command.
elinuxbook@ubuntu:~$ ifconfig # Check Network Interfaces
This method we have to do using terminal. So to configure Static IP address we have to edit a configuration file named interfaces. The location of this file is /etc/network/interfaces. So post editing the file using your preferred text editor you have to enter all the details i.e. IP Address, Subnet Mask, Gateway Address and DNS Servers manually. Here the name of my Network Interface is ens33. Refer the command below.
Note : The configuration part highlighted in Yellow color.
elinuxbook@ubuntu:~$ sudo nano /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback auto ens33 iface ens33 inet static address 192.168.1.50 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 192.168.1.100 192.168.1.101
After configuring the IP address by following above steps you have to refresh the settings by flush the Network Interface using below command.
elinuxbook@ubuntu:~$ sudo ip addr flush ens33
Now restart the Networking Service to take effect the changes using below command.
elinuxbook@ubuntu:~$ sudo systemctl restart networking.service
Now we are Done. To check the configured Static IP address refer the below command.
elinuxbook@ubuntu:~$ ifconfig ens33 ens33 Link encap:Ethernet HWaddr 00:0c:29:ff:cd:2e inet addr:192.168.1.50 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4833 errors:0 dropped:0 overruns:0 frame:0 TX packets:3446 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:6985228 (6.9 MB) TX bytes:292627 (292.6 KB)
Method : 2
Now let’s have a look at Graphical way of static IP Address configuration. This step is quiet simple to follow and easy way to configure IP address. So to configure the IP address in graphical way just click on Search Box on your Ubuntu 16.04 and Search for Network Connection. Refer the snapshot below.
Now click on Network Connections icon and you will get the below screen. Just select the Network Connection you want to configure and click on Edit button.
Also Read :
- HOW TO CONFIGURE STATIC IP ADDRESS IN LINUX USING WEBMIN
- 28 MOST FREQUENTLY USED BASIC LINUX COMMANDS WITH EXAMPLES
- COMPLETE UNIX COMMANDS AND BASIC LINUX COMMANDS WITH EXAMPLES FOR BEGINNERS
After above step you will get the below screen in-front of you. Here go to IPv4 Settings tab, click on Add button and do below mentioned settings.
- Method : Select the Manual method from the drop down list.
- Addresses : Here enter your IP Address, Netmask, Gateway details.
- DNS Servers & Search Domains : Here enter your DNS Server IP Addresses.
After configuring all above steps just click on Save button to save all settings. Refer the snapshot below.
Now it’s Done. To Refresh the configuration just disconnect and connect the Network connection. You will get that setting from task manager. Refer the snapshot below.
Here in this article I explained what is static IP and how we can configure static ip address in Ubuntu 16.04. If you have some query regarding this article you can comment on comment box below.
If you found this article useful then Like us, Share this post on your preferred Social media, Subscribe our Newsletter OR if you have something to say then feel free to comment on the comment box below.