LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-26-2009, 02:41 PM   #1
tempest
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, 03:23 PM   #2
phillinux
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:

nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx

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, 03:33 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,541
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

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;

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

Code:
 sample '/etc/resolv.conf';

search 192.168.0.1     

nameserver xxx.xxx.xxx.xxx   #ISP DSN 'replace xxx.xxx.xxx.xxx
                             #with IP from your ISP
nameserver 4.2.2.1           #Verizon third level DNS
nameserver 4.2.2.2
nameserver 4.2.2.3
nameserver 4.2.2.4
 
Old 09-26-2009, 03:39 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
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 192.168.1.100
Every IP untill 192.168.1.99 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, 08:12 AM   #5
tempest
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!!!
 
  


Reply


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 03:45 PM
apache2 router conflict NorthWind Linux - Networking 2 01-04-2008 12:17 PM
static ip from router true_atlantis SUSE / openSUSE 2 04-06-2006 11:32 PM
Broadband Connection Via Router Intermittent - DHCP Conflict? JamboUK Linux - Networking 1 05-06-2004 09:01 PM
static IP behind router shadowhunter Linux - Networking 2 01-04-2004 05:20 PM


All times are GMT -5. The time now is 04:47 PM.

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