Thursday, 24 May 2012
 Home arrow Blog arrow How to Change DHCP to Static IP Address on Ubuntu Server
   
Main Menu
Home
News
Blog
Links
Search
FAQs
Spider
Articles
@intrenet
Free Softwares
Break for fun
Friends VIdeos
Techno videos
Contact Us
Disclaimer
Guest Book
Speed test
V.E.C. Calculator
IPv4 Subnet Calc
IPv6 Subnet Calc
Byte Converter
Converter
GMT/UTC Time
Bandwidth Calc
Allinone Calc
IANA Port Numbers
Country Call Codes
Pk Postal Codes
Surf Anonumously
Visitors Counter
mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday187
mod_vvisit_counterYesterday302
mod_vvisit_counterThis week749
mod_vvisit_counterThis month5298
mod_vvisit_counterAll125974
 
 
 
 


How to Change DHCP to Static IP Address on Ubuntu Server PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Amanatullah khalil   
Saturday, 23 May 2009

How to Change DHCP to Static IP Address on Ubuntu Server

Changing this setting without a GUI will require some text editing, but that’s classic linux, right?

Let’s open up the /etc/network/interfaces file. I’m going to use vi, but you can choose a different editor

sudo vi /etc/network/interfaces

For the primary interface, which is usually eth0, you will see these lines:

auto eth0
iface eth0 inet dhcp

As you can see, it’s using DHCP right now. We are going to change dhcp to static, and then there are a number of options that should be added below it. Obviously you’d customize this to your network.

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 we’ll need to add in the DNS settings by editing the resolv.conf file:

sudo vi /etc/resolv.conf

On the line ‘name server xxx.xxx.xxx.xxx’ replace the x with the IP of your name server. (You can do ifconfig /all to find out what they are)

You need to also remove the dhcp client for this to stick (thanks to Peter for noticing). You might need to remove dhcp-client3 instead.

 

sudo apt-get remove dhcp-client 

Now we’ll just need to restart the networking components:

sudo /etc/init.d/networking restart

Thanks to  http://techgurulive.com/2009/02/20/how-to-change-dhcp-to-static-ip-address-on-ubuntu-server/

 
< Prev   Next >
 
 
 
csatpk Newsflash
Statistics
OS: Linux h
PHP: 5.2.17
MySQL: 5.1.63-community-log
Time: 03:02
Caching: Disabled
GZIP: Disabled
Members: 3
News: 368
Web Links: 5
Visitors: 266568
Popular