Set static ip in Ubuntu

This simple tutorial will show you how to set a static ip address in Ubuntu.To configure your system to use a static IP address assignment, add the static method to the inet address family statement for the appropriate interface in the file /etc/network/interfaces

1.Confirm your network interface name using below command,normally it’s eth0

ifconfig -a

2.Open network configuration file use below command

sudo vi /etc/network/interfaces


sudo nano /etc/network/interfaces

3.Remove or comment below line(if have),assume your interface name is eth0

iface eth0 inet dhcp

4.Append below lines.

iface eth0 inet static

5.Restart networking service to enable the change

sudo /etc/init.d/networking restart

6.Done,you just set a static ip address for you Ubuntu,you can verify this use below command

ifconfig eth0

2 thoughts on “Set static ip in Ubuntu

  1. Pingback: Set static ip in Ubuntu

  2. Rahul chaudhary

    I have a 1st time use ubuntu 12.04 os . And my laptop not play Audio & videos songs and wireless not working. Please help me. I have wait for your answer so please early to repily


Leave a Reply

Your email address will not be published. Required fields are marked *