LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 02-13-2007, 01:13 AM   #1
UmneyDurak
Member
 
Registered: Jun 2004
Posts: 178

Rep: Reputation: 30
Internet problems


I have three computers, including my laptop. All of them behind router. I have ubuntu installed on my laptop. It just replaced FC3 on it. Anyway I am having trouble connecting to the internet, but I can connect to other computers on the network.
What I have done so far:
So I set DNS Server to 192.168.0.1 and removed everything from Search Domains. I was able to connect to the internet. I suspended my laptop. When I brought it back up I couldn't connect anymore. I went to the Networking and DNS Server was back to 192.168.1.2, and there was something under Search Domains.
I removed everything and put 192.168.0.1 under DNS server. Didn't help. I then went to wired connection properties and switched from Automatic Configuration to Static. Putting IP as 192.168.0.6, subnet mask as 255.255.255.0, Gateway as 192.168.0.1 and was able to connect. Switched back to automatic couldn't connect anymore. Removed DNS Server and added back again, and was able to connect.
What a heck is going on?

So to summarize every time I restart my laptop or it goes to the stand by, my network settings get reset. DNS Server entry is replaced with 192.168.1.2, and something (forgot the name) is added to Search Domains. After switching between static and automatic, few times. It seems to work again. I never had this problem with FC3 or FC2. Seems it works more consistently with static IP, but it keeps resetting to auto for no apparent reason. Also on auto, when it works, I can only connect to certain websites. What is going on?

Thanks.

Last edited by UmneyDurak; 02-13-2007 at 01:15 AM.
 
Old 02-13-2007, 02:34 AM   #2
jimbo1954
Member
 
Registered: Oct 2006
Location: High Wycombe, Bucks, UK.
Distribution: Debian and Fedora Core in equal measure
Posts: 264

Rep: Reputation: 33
Quote:
Originally Posted by UmneyDurak
So to summarize every time I restart my laptop or it goes to the stand by, my network settings get reset. DNS Server entry is replaced with 192.168.1.2, and something (forgot the name) is added to Search Domains. After switching between static and automatic, few times. It seems to work again. I never had this problem with FC3 or FC2. Seems it works more consistently with static IP, but it keeps resetting to auto for no apparent reason. Also on auto, when it works, I can only connect to certain websites. What is going on?
Sounds like your PC is set up to pick up its IP address from a DHCP server. This will replace things like IP address, gateway address, DNS server address etc. Under these conditions, when the PC is booted or comes back from suspend, it broadcasts a DHCP request (basically saying to anyone listening on the network "Who am I? where is everyone?" a bit like when you wake on a Sunday morning after a too-enthusiastic Saturday night!)

First find the server that is responding, then edit the DHCP server configuration file so that it gives you the configuration you want the PC to have.


HTH
Jimbo
 
Old 02-13-2007, 08:04 AM   #3
UmneyDurak
Member
 
Registered: Jun 2004
Posts: 178

Original Poster
Rep: Reputation: 30
Umm... How do I do that?
 
Old 02-13-2007, 03:13 PM   #4
jimbo1954
Member
 
Registered: Oct 2006
Location: High Wycombe, Bucks, UK.
Distribution: Debian and Fedora Core in equal measure
Posts: 264

Rep: Reputation: 33
Well, on any *NIX systems on the local net, you would issue the following command:
aardvark:~# ps -ef | grep dhcp

which will give you something like the following:

root 4897 1 0 Feb08 ? 00:00:00 /usr/sbin/dhcpd -q eth1
root 20176 20171 0 20:50 pts/0 00:00:00 grep dhcp

where the top line of the output shows the dhcpd process running. You could deal with this by killing the process (kill 4897 in this case), though this is only temporary, till restart, when the dhcpd daemon will be automatically restarted. Its a good way to prove a point, though, without doing any (potentially serious) damage.

Alternatively you could load something like ethereal on to one of the systems on the network, and use it to watch the dhcp sequence going down the wire at startup time. Debugging network problems with analysers like this is also worthwhile just for the knowledge of a very common and useful system tool (dhcpd) that you would gain.

Ultimately, you will need to use yum (Fedora) or synaptic (Debian) or something similar to get the dhcpd subsystem off the system.

Try that, then tell us how you get on

HTH
Jimbo

Of course, it could be that dhcpd is running on a windoze system on the net, in which case look in the services menu in the control panel, and STOP RUNNING WINDOZE
 
Old 02-13-2007, 09:13 PM   #5
fragos
Senior Member
 
Registered: May 2004
Location: Fresno CA USA
Distribution: Ubuntu 10.10
Posts: 1,466

Rep: Reputation: 51
The default install is almost always set up for DCHP as is your router. You're using NAT on the router, hence the local IP addressing which can't be used outside your LAN. Truth is if you hadn't attempted to configure IP's everthing would have worked out of the box. Enable DCHP on all your boxes.
 
Old 02-13-2007, 11:15 PM   #6
UmneyDurak
Member
 
Registered: Jun 2004
Posts: 178

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by fragos
The default install is almost always set up for DCHP as is your router. You're using NAT on the router, hence the local IP addressing which can't be used outside your LAN. Truth is if you hadn't attempted to configure IP's everthing would have worked out of the box. Enable DCHP on all your boxes.
Thats the thing it didn't work out of the box. I had to twick it to get it to work. Honestly I have no idea what is going on. I leave it on static IP. Go to standby, come back it populates DNS Server with wrong local IP, and Search Domain Server with some value. After switching back and forth it seems work again.
FC3 worked out of the box, both of my windows machines automatically acquire local IP and work. This one doesn't. Really frustrating. Only thing that seems to work is switching from auto to static, and back. Through Network Tools it shows correct IP 192.168.0.2 for eth0 even when I can't connect to the internet. In all cases I can connect to my other local machines.

Last edited by UmneyDurak; 02-13-2007 at 11:37 PM.
 
Old 02-13-2007, 11:25 PM   #7
UmneyDurak
Member
 
Registered: Jun 2004
Posts: 178

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jimbo1954
Well, on any *NIX systems on the local net, you would issue the following command:
aardvark:~# ps -ef | grep dhcp

which will give you something like the following:

root 4897 1 0 Feb08 ? 00:00:00 /usr/sbin/dhcpd -q eth1
root 20176 20171 0 20:50 pts/0 00:00:00 grep dhcp

where the top line of the output shows the dhcpd process running. You could deal with this by killing the process (kill 4897 in this case), though this is only temporary, till restart, when the dhcpd daemon will be automatically restarted. Its a good way to prove a point, though, without doing any (potentially serious) damage.

Alternatively you could load something like ethereal on to one of the systems on the network, and use it to watch the dhcp sequence going down the wire at startup time. Debugging network problems with analysers like this is also worthwhile just for the knowledge of a very common and useful system tool (dhcpd) that you would gain.

Ultimately, you will need to use yum (Fedora) or synaptic (Debian) or something similar to get the dhcpd subsystem off the system.

Try that, then tell us how you get on

HTH
Jimbo

Of course, it could be that dhcpd is running on a windoze system on the net, in which case look in the services menu in the control panel, and STOP RUNNING WINDOZE
It is restarted after laptop comes back from suspend. Resets the DNS Server entry and sets Search Domains to Belkin.

Last edited by UmneyDurak; 02-13-2007 at 11:36 PM.
 
Old 02-14-2007, 02:43 AM   #8
jimbo1954
Member
 
Registered: Oct 2006
Location: High Wycombe, Bucks, UK.
Distribution: Debian and Fedora Core in equal measure
Posts: 264

Rep: Reputation: 33
You wrote "Resets the DNS Server entry and sets Search Domains to Belkin". Well, there's a start... if the Search Domain is set to "Belkin", its almost certain where the DHCP server is located...it's in your Belkin Router.

I wonder, when you make your changes to the networking on the Ubuntu PC, do you just change them in the GUI rather than hacking the files? It could be that you are changing the set up from the GUI, but not hitting "save", so the changes are only valid for the duration of the session. This would give you the characteristics you describe.

I would be inclined to do one of two things:
1) Set up the DHCP server in your router so it serves the correct data. This is the preferable way forward, because any device that you put on your network in future will benefit. You will need to RTFM to know how to set the router, but they are usually pretty simple...if you have probs, tell us the Router type/number and we can probably help more (the manuals can most likely be downloaded from the manufacturer site);

2) Stop using/allowing DHCP all together, disable DHCP on your PCs, so they can't get any configs from any server, and set up the characteristics on each network interface completely statically. If you plan to do it this way, its probably best to actually hack the files directly, not use the GUI. It will take longer, and you will have to do some research, but at the end of the process, you will understand what is happening in the machine. (if you didn't care what was happening, you wouldn't be here!)

For what it's worth, unless you run servers that need to be accessed from the Internet, I would go with solution (1), it reduces management overhead and means you don't have to remember so much

One other point...I tend to agree with Fragos, that it should all work OOB, but there appears to be a misconfiguration of the Router, which seems to be serving wrong data.

Keep trying!

Jimbo
 
Old 02-14-2007, 10:34 PM   #9
UmneyDurak
Member
 
Registered: Jun 2004
Posts: 178

Original Poster
Rep: Reputation: 30
Well I have wired Netgear router not Belkin. I don't have a clue where it is getting that information.
So here is my config files after I got Internet to work:
Quote:
root@alexlaptop:~# cat /etc/resolv.conf
search 192.168.0.1
nameserver 192.168.0.1
root@alexlaptop:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback


iface eth0 inet static
address 192.168.0.6
netmask 255.255.255.0
gateway 192.168.0.1

auto eth1
iface eth1 inet dhcp

auto eth2
iface eth2 inet dhcp

auto ath0
iface ath0 inet dhcp

auto wlan0
iface wlan0 inet dhcp


auto eth0
So it's set to static. Now here what happens after it comes back from suspend:
Quote:
root@alexlaptop:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback


iface eth0 inet static
address 192.168.0.6
netmask 255.255.255.0
gateway 192.168.0.1

auto eth1
iface eth1 inet dhcp

auto eth2
iface eth2 inet dhcp

auto ath0
iface ath0 inet dhcp

auto wlan0
iface wlan0 inet dhcp


auto eth0
root@alexlaptop:~# cat /etc/resolv.conf
search Belkin
nameserver 192.168.2.1
interfaces remains unchanged, but resolv.conf gets reset. Where the heck is it grabbing this information?
Here are my router settings. Looks ok to me, and other computer do grab correct IP from it.
http://i104.photobucket.com/albums/m...rak/router.jpg

Ok, apparently my neighbor has Belkin router. So instead of grabbing the IP from my router using wired connection, or the connfig files it's grabbing it using wireless card from my neighbors router! How can I stop it?

Last edited by UmneyDurak; 02-14-2007 at 11:13 PM.
 
Old 02-15-2007, 02:35 AM   #10
jimbo1954
Member
 
Registered: Oct 2006
Location: High Wycombe, Bucks, UK.
Distribution: Debian and Fedora Core in equal measure
Posts: 264

Rep: Reputation: 33
Now that is *weird*!
I can only assume that your WLAN is, as you suggest, picking up the configuration from your neighbour's Belkin (is he in range?). That further presupposes that you are both using the same Wireless security method and crypto setup...what are the chances of that?? (Unless you are both running without security,on the wireless, and from what you have done so far, I guess you have sufficient smarts not to do that ). If that were not the case, there would be no wireless path for the DHCP to work over, so the problem would not occur.

OK, have you tried disabling the WLAN interface (or disabling dhcp on it) and rebooting with it disabled/down?...that would be a simple way of proving that the problem is coming from the neighbour's WLAN AP. Then, if the cause is proven, you can change your wireless security so that you can't establish a low-level link to the Belkin, then DHCP won't be able to access the AP, and your config should stay put.

That begs the question "Why did it not happen on FC3, but does on Ubuntu..."I guess that is down to a configurational issue, where they behave a bit differently OOB.

The only other thing to do would be to stop DHCP from changing the DNS configuration by some configuration changes specific to the WLAN i/face, and currently, I have *no idea* how to do that without being much more aggressive with the configs than you want, and disabling the "good" things its doing.

I think first stop is disable WLANO, reboot and see what happens, and post the results. Then we'll see what can be done!

Later
Jimbo
 
Old 02-20-2007, 10:30 PM   #11
UmneyDurak
Member
 
Registered: Jun 2004
Posts: 178

Original Poster
Rep: Reputation: 30
So I changed my interfaces file to this:
Quote:
...@alexlaptop:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback


iface eth0 inet dhcp
address 192.168.0.6
netmask 255.255.255.0
gateway 192.168.0.1

#auto eth1
#iface eth1 inet dhcp

auto eth2
iface eth2 inet dhcp

auto ath0
iface ath0 inet dhcp

auto wlan0
iface wlan0 inet dhcp




auto eth0
Now it works just fine. Picking my IP from my wired router. So I guess it was picking up the info form my neighbors wireless router instead of mine wired router. Why would it do that, when my laptop is connected to my router by a cable? This works but now I have to modify that file to use my wireless. Is there a better solution?
 
Old 02-21-2007, 02:34 AM   #12
jimbo1954
Member
 
Registered: Oct 2006
Location: High Wycombe, Bucks, UK.
Distribution: Debian and Fedora Core in equal measure
Posts: 264

Rep: Reputation: 33
A bigger Concern....

OK, you have it working now, but there is a much greater concern than DHCP just now!
You have proven that you were picking up information from your neighbour's WLAN. This means that there is an open IP path over the wireless from you to his router. You were affected by it, in that is screwed your communications.

What is a much greater concern is that the security configuration between his network and yours is compromised (near non-existent). I'm not saying your neighbour would try anything, but if you can get IP communications with him, he can with you, and that eliminates any security between the two nets. He could use your bandwidth, you could potentially use his. Equally, if the security is so open that you have a fortuitous connection, then a third party with lesser morals could connect to either of your networks without too much effort and do all kinds of nasty things.

First thing to do is sort your wireless security. Use WPA-PSK (Wi-Fi Protected Access with Pre-Shared Key), stop broadcasting your SSID, and advise your neighbour to do the same.

Do it NOW!
 
Old 02-21-2007, 09:59 AM   #13
UmneyDurak
Member
 
Registered: Jun 2004
Posts: 178

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jimbo1954
OK, you have it working now, but there is a much greater concern than DHCP just now!
You have proven that you were picking up information from your neighbour's WLAN. This means that there is an open IP path over the wireless from you to his router. You were affected by it, in that is screwed your communications.

What is a much greater concern is that the security configuration between his network and yours is compromised (near non-existent). I'm not saying your neighbour would try anything, but if you can get IP communications with him, he can with you, and that eliminates any security between the two nets. He could use your bandwidth, you could potentially use his. Equally, if the security is so open that you have a fortuitous connection, then a third party with lesser morals could connect to either of your networks without too much effort and do all kinds of nasty things.

First thing to do is sort your wireless security. Use WPA-PSK (Wi-Fi Protected Access with Pre-Shared Key), stop broadcasting your SSID, and advise your neighbour to do the same.

Do it NOW!
I don't have wireless router, there is a physical cable connecting my laptop to my router! Unless you are talking about a card on my laptop?
And oh yeah my "brilliant" neighbor is running wireless with no encryption and default password on his router.

Thanks.

Last edited by UmneyDurak; 02-21-2007 at 10:00 AM.
 
Old 02-22-2007, 02:59 AM   #14
jimbo1954
Member
 
Registered: Oct 2006
Location: High Wycombe, Bucks, UK.
Distribution: Debian and Fedora Core in equal measure
Posts: 264

Rep: Reputation: 33
Well, you'll get out of prison for assaulting the neighbour for running an unprotected W-LAN soon , and when you do, you need to tighten up your own configs: you were definately picking up his DHCP service somehow, and you showed wlan0 in your config:

iface eth0 inet dhcp
address 192.168.0.6
netmask 255.255.255.0
gateway 192.168.0.1

#auto eth1
#iface eth1 inet dhcp

auto eth2
iface eth2 inet dhcp

auto ath0
iface ath0 inet dhcp

auto wlan0
iface wlan0 inet dhcp

So I guess, in common with my Vaio, and a whole bunch of recent laptops, you have inbuilt wireless, and you were picking up any wireless in range (like your neighbour's). That potentially leaves you exposed on the wireless front!

You may have a nice simple solution: there should be a switch to disable the wireless, certainly my PC has one, as do others that have inbuilt wireless, try switching it off. Whatever, you need to do some wireless security work, and so does your neighbour!

HTH
Jimbo
 
  


Reply



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
!!!!!! internet Problems !!!!! neoAThome Mandriva 3 01-28-2005 07:24 AM
Kppp problems/Internet Problems Lineux Linux - Newbie 2 09-29-2004 03:58 PM
internet problems bond00 Linux - Wireless Networking 9 09-29-2004 10:00 AM
Internet Problems! shayan_tabrizi Linux - Software 2 08-02-2004 03:48 AM
internet problems with mandrake 10, eth problems rApT0r Linux - Newbie 10 04-11-2004 06:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:42 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
Open Source Consulting | Domain Registration