How to set a Static IP in Ubuntu Linux

How to set a Static IP in Ubuntu Linux

Open the terminal command line application or ssh into the remote server. Type the following command:

sudo vi /etc/network/interfaces


OR


sudo nano /etc/network/interfaces

Make the changes as follows:

auto eth0
iface eth0 inet static
 address 10.10.29.66
 netmask 255.255.255.192
 network 10.10.29.65
 broadcast 10.10.29.127
 gateway 10.10.29.65
# Google dns server for our network
 dns-nameservers 8.8.8.8 8.8.4.4

Save and close the file. Restart networking on Ubuntu Linux 14.04 LTS or older:

$ sudo /etc/init.d/networking restart

If you are using a system based Ubuntu Linux version such as 16.04 LTS or above, enter:

$ sudo systemctl restart networking

 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

12 Useful “df” Commands to Check Disk Space in Linux

Useful df Command Examples This article explain a way to get the full information of Linux disk...

How to Disable SELinux

How to Disable SELinux You’ve setup a new system, or installed something new on your Linux...

Linux Check Disk Space Command To View System Disk Usage

Linux Check Disk Space Command To View System Disk Usage Linux command to check disk space...

How to Quickly Set up a Mail Server on Ubuntu 18.04 with Modoboa

This tutorial is going to show you how to quickly set up your own email server on Ubuntu 18.04...