Changing IP Address from DHCP to Static IP in Ubuntu

Hello… this will remind me.. hihhihi…

ok, lets now open the interfaces file

$ sudo vim /etc/network/interfaces

for the default, you’ll see in the file

auto eth0
iface eth0 inet dhcp

ok, now we’re going to change the way from DHCP to Static, just enter these text, and suit to your needs

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

now, set the DNS setting by open and edit the file

$ sudo vim /etc/resolv.conf

on the line “name server xxx.xxx.xxx.xxx”  replace the x with your nameserver,

you can do ifconfig /all to find out what they are.

ok, thats all…  the last u have to do is, removing the DHCP client and Restart the Net-Interface

$ sudo apt-get remove dhcp-client

& restart the network

$ sudo /etc/init.d/networking restart

 

See you….. 🙂

 

 

Advertisements
Changing IP Address from DHCP to Static IP in Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s