Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-26-2009, 01:41 PM   #1
LQ Newbie
Registered: Sep 2009
Posts: 2

Rep: Reputation: 0
Static IP and router conflict???

I am trying to assign a static ip address to my ubuntu 9.04 install. I was able to do so after following the instructions on another thread. However, after establishing my connection with that configuration, I was no longer able to connect to the internet (As a DHCP connection I was able to connect). I am using a Dlink DI-704 router. I cant help but think I did not set up (any combination of) the ip address, netmask, gateway, dns server, or MAC address correctly. Do the routers addresses come into play here with the static address?
Old 09-26-2009, 02:23 PM   #2
LQ Newbie
Registered: Mar 2009
Posts: 14

Rep: Reputation: 0
Simple question, complex answer:
When you allow DHCP to give your computer its IP configuration It will (most of the time) supply an IP number, subnet mask, default gateway, DNS server and some other info if configured. If you give yourself a static IP address, it then becomes your responsibility to supply all the information that DHCP delivers. You are unable to get the Internet because you probably have no DNS server configured.

Go to the /etc/resolve.conf file and put an entry for your ISPs DNS server as follows:


where the DNS server is entered in dotted decimal format. To find the ISPs primary and secondary DNS server look in your router's configuration status page.
Old 09-26-2009, 02:33 PM   #3
Registered: Jan 2005
Location: Summer Midwest USA, Central Illinois, Winter Central Florida
Distribution: SlackwareŽ
Posts: 13,622
Blog Entries: 34

Rep: Reputation: 2803Reputation: 2803Reputation: 2803Reputation: 2803Reputation: 2803Reputation: 2803Reputation: 2803Reputation: 2803Reputation: 2803Reputation: 2803Reputation: 2803

Welcome to LQ!

You do need to configure the network configuration when you setup a 'static IP'.

DNS would require the '/etc/resolv.conf' to show your nameservers.

I don't use the *buntus but you would still need to setup the the 'IP', Mask for the device. You would then need to setup the route for the device. The config files would allow you to perform the requirements for the 'inet' or use the commands from the cli; 'ifconfig', 'route'.

I would setup a static IP first, do as root from cli;

~#ifconfig -a                      #get recognized devices
~#ifconfig wlan0      #set to a available IP
~#route add default gw #set to your gateway
~#route -n                         #show the route table
~#ifconfig wlan0 up                #should be up already
~#ping                 #ping your gateway
~#ping      IP
~#ping                  #test DNS, if fail then
                                   #check /etc/resolv.conf
You should have your '/etc/resolv.conf' setup with your 'ISP DNS' nameservers.

 sample '/etc/resolv.conf';


nameserver   #ISP DSN 'replace
                             #with IP from your ISP
nameserver           #Verizon third level DNS
Old 09-26-2009, 02:39 PM   #4
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
If the router uses DHCP, you need to take an IP that is not in the pool from DHCP
On the router you need to configure DHCP to start from a certain IP, lets say
Every IP untill can be used as fixed IP, except the ip from the router itself, which will be the default GW.
You need to provide the default GW, netmask and DNS yourself.

A simple way is:
Connect via DHCP and use
ifconfig => to find netmask
route -n => to find default GW
cat /etc/resolv.conf => to find the DNS

Use these values to configure your network

If you have only 1 computer in the network, disable DHCP on the router
Old 09-28-2009, 07:12 AM   #5
LQ Newbie
Registered: Sep 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks to everyone for your reply's. It was, as I suspected, incorrect settings for the GW and DNS. Your reply's steered me in the right direction. This site is a fantastic resource!!!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Router and Static IP? mikeshn Linux - Networking 3 09-26-2009 02:45 PM
apache2 router conflict NorthWind Linux - Networking 2 01-04-2008 11:17 AM
static ip from router true_atlantis SUSE / openSUSE 2 04-06-2006 10:32 PM
Broadband Connection Via Router Intermittent - DHCP Conflict? JamboUK Linux - Networking 1 05-06-2004 08:01 PM
static IP behind router shadowhunter Linux - Networking 2 01-04-2004 04:20 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:25 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration