How to Set Static Ip adress in Ubuntu 17

39 viewsLinux
0

i have Ubuntu  17 installed and i want to setup   Static Ip adress on my system, what steps i have to do

Answered question
0

For setting permanent  static network ip addess in Ubuntu, need to add the IP  information to network  configuration file [/etc/network/interfaces ]

  1. Edit network  configuration file /etc/network/interfaces [sudo vi /etc/network/interfaces]

Network  configuration file  looks like below

auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Save the  configuration and  restart  the network  service to  start using Static IP address

sudo /etc/init.d/networking restart

Edited answer