how to convert ip from dynamic to static in ubuntu?

Source From :-
http://www.unixmen.com/how-to-convert-my-ip-from-dynamic-to-static-in-ubuntu/

 1. First edit network interface using your favorite text editor/terminal :

    sudo vi /etc/network/interfaces
    sudo nano /etc/network/interfaces
    sudo gedit /etc/network/interfaces

Normally you  are  using   eth0  for  card  ethernet  you will see  some  thing  like  this :

    auto eth0
    iface eth0 inet dhcp

2. Remove line 2 and add:

    auto eth0
    iface eth0 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1

    save a and  exit

    192.168.1.100 suppose  to be  your  static  IP you can change it  to  the IP   you  want

    192.168.1.1 is  the  router  IP

Now we’ll need to add in the DNS settings by editing the resolv.conf file:

    sudo vi /etc/resolv.conf

and  add  the 2 ip adresss  of  your  DNS servers  ( internet provider)

3- remove dhcp client

In terminal, type the following command:

    sudo apt-get remove dhcp-client

4- Restart network

    sudo /etc/init.d/networking restart

Now you shloud have a static IP instead of dynamic one.

Is done.

First edit network interface using your favorite text editor :

sudo vi /etc/network/interfaces

Normally you  are  using   eth0  for  card  ethernet  you will see  some  thing  like  this :

auto eth0
iface eth0 inet dhcp

Remove line 2 and add:

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

save a and  exit
192.168.1.100 suppose  to be  your  static  IP you can change it  to  the IP   you  want
192.168.1.1 is  the  router  IP

Now we’ll need to add in the DNS settings by editing the resolv.conf file:

sudo vi /etc/resolv.conf

and  add  the 2 ip adresss  of  your  DNS servers  ( internet provider)
3- remove dhcp client
In terminal, type the following command:

sudo apt-get remove dhcp-client

4- Restart network

sudo /etc/init.d/networking restart

Now you shloud have a static IP instead of dynamic one.
Is done.
– See more at: http://www.unixmen.com/how-to-convert-my-ip-from-dynamic-to-static-in-ubuntu/#sthash.jV5JJv6s.dpuf

First edit network interface using your favorite text editor :

sudo vi /etc/network/interfaces

Normally you  are  using   eth0  for  card  ethernet  you will see  some  thing  like  this :

auto eth0
iface eth0 inet dhcp

Remove line 2 and add:

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

save a and  exit
192.168.1.100 suppose  to be  your  static  IP you can change it  to  the IP   you  want
192.168.1.1 is  the  router  IP

Now we’ll need to add in the DNS settings by editing the resolv.conf file:

sudo vi /etc/resolv.conf

and  add  the 2 ip adresss  of  your  DNS servers  ( internet provider)
3- remove dhcp client
In terminal, type the following command:

sudo apt-get remove dhcp-client

4- Restart network

sudo /etc/init.d/networking restart

Now you shloud have a static IP instead of dynamic one.
Is done.
– See more at: http://www.unixmen.com/how-to-convert-my-ip-from-dynamic-to-static-in-ubuntu/#sthash.jV5JJv6s.dpuf

First edit network interface using your favorite text editor :

sudo vi /etc/network/interfaces

Normally you  are  using   eth0  for  card  ethernet  you will see  some  thing  like  this :

auto eth0
iface eth0 inet dhcp

Remove line 2 and add:

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

save a and  exit
192.168.1.100 suppose  to be  your  static  IP you can change it  to  the IP   you  want
192.168.1.1 is  the  router  IP

Now we’ll need to add in the DNS settings by editing the resolv.conf file:

sudo vi /etc/resolv.conf

and  add  the 2 ip adresss  of  your  DNS servers  ( internet provider)
3- remove dhcp client
In terminal, type the following command:

sudo apt-get remove dhcp-client

4- Restart network

sudo /etc/init.d/networking restart

Now you shloud have a static IP instead of dynamic one.
Is done.
– See more at: http://www.unixmen.com/how-to-convert-my-ip-from-dynamic-to-static-in-ubuntu/#sthash.jV5JJv6s.dpuf

First edit network interface using your favorite text editor :

sudo vi /etc/network/interfaces

Normally you  are  using   eth0  for  card  ethernet  you will see  some  thing  like  this :

auto eth0
iface eth0 inet dhcp

Remove line 2 and add:

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

save a and  exit
192.168.1.100 suppose  to be  your  static  IP you can change it  to  the IP   you  want
192.168.1.1 is  the  router  IP

Now we’ll need to add in the DNS settings by editing the resolv.conf file:

sudo vi /etc/resolv.conf

and  add  the 2 ip adresss  of  your  DNS servers  ( internet provider)
3- remove dhcp client
In terminal, type the following command:

sudo apt-get remove dhcp-client

4- Restart network

sudo /etc/init.d/networking restart

Now you shloud have a static IP instead of dynamic one.
Is done.
– See more at: http://www.unixmen.com/how-to-convert-my-ip-from-dynamic-to-static-in-ubuntu/#sthash.jV5JJv6s.dpuf