ubuntu : how do you configure it to...

konakona

Diamond Member
May 6, 2004
6,285
1
0
howdy folks,
ubuntu newbie here again :)
the ubuntu rig does not seem to be able to automatically recover from router resets unlike the windows machines - wont even connect itself back to the lan.

Is there a way to rectify this? (ie let it reconfigure itself automatically everytime the conenction gets severed). Or otherwise, I wouldnt mind learning a manual solution, although that would be somewhat cumbersome given our circumstances of having to reset the router here and there (dont ask :))
 

SleepWalkerX

Platinum Member
Jun 29, 2004
2,649
0
0
Hmm, that shouldn't be happening.. Well at least it doesn't for me. What happens is my network card keeps the same address and is just able to talk to the router again once it boots back up from being reset. I'm running Suse, but it shouldn't matter. My bro runs Ubuntu and the same can be said for him..

edit: As far as suggestions go, why not setup a static ip?
 

konakona

Diamond Member
May 6, 2004
6,285
1
0
yeah, maybe i should set that up.. someday :)
just too lazy to get it done, maybe I will just go ahead and do that tomorrow.

The trouble though, is not the dynamic allocation of internal ip addresses thrugh DHCP; rather, the ubuntu box loses its connection regardless of what ip it is assigned to. Perhaps I turned off some essential services?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Worst case when the router reboots is that some connections should time out and be rebuilt but that's it. What do you mean 'loses it's connection'? Can you ping the router once it's back up? There is the chance that the router could reboot right when the Linux box is attempting to re-lease it's IP but unless the router takes a very long time to come up that shouldn't be a problem either.
 

konakona

Diamond Member
May 6, 2004
6,285
1
0
ok, I should have been clearer in my initial post. This really doesnt pertain a full reboot of the router, havnt tried that yet in fact. I just have to keep on changing certain things in the router setup, and that temporarily disables the router functionality for about 10 seconds. Windows machines seem to be unaffected by this at all, returning to normal expected behavior right after. The same could not be said about the ubuntu box however; pinging 192.168.1.1 (the router) or any 192.168.1.10x (other computers) results in destination host unreacheable.

Also, this seems to be 'fixed' upon restarting the linux box. I highly doubt that is the standard procedure to deal with this, and hopefully there is a better way to do this :(
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
I don't know why it's doing that. Having a router go down doesn't typically cause any problems for me.

Try bringing down the network interface and then bringing it back up again. By default ethernet connections are named eth* with the first one being eth0.

In Debian and debian-based systems (like ubuntu) you have ifdown and ifup commands for controlling the interface. So then go:
sudo ifdown eth0
sudo ifup eth0

And see if it works. After that then you can see if there is a way to automate it or figure out exactly why this is happenning.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The router going away shouldn't affect local connectivity no matter what, you should be able to ping the Windows box from the Linux box even if the router is in the kitchen on fire.
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Might the router lose all the client leases upon reboot?

It seems like Ubuntu should be able to recover, but it doesn't like Windows does, in my experience.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Might the router lose all the client leases upon reboot?

It shouldn't matter, the Linux box will keep using the IP it was given for the whole lease time. If by chance the router is unavailable right when it tries to renew it's lease that _might_ cause a problem but the chances of that happening are pretty slim unless the lease time is really, really small.
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
I should have said, won't the clients lose their lease when the router reboots? I'm not sure how a router works, but it would have to save its lease table to some 'hard drive' if it were to be available again upon reboot. So, before the router was shut down it gave client X an address of 192.168.1.101. Now that it's rebooted, it has no idea what client X was and can't serve that address properly anymore.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Sure, but unless the router is really crappy it should ping any addresses before handing them out so that the clients won't dup each other. Then when the client with that address goes to renew the DHCP server should either give it the same address since it asked to renew it or tell it no and make it get a new one, either way networking should be minimally affected.
 

Yakomo

Senior member
Dec 8, 1999
269
0
76
Open up a terminal and type

sudo /etc/init.d/networking restart

That should restart your network services and it should pull a new or update your IP from your router without rebooting your entire box.
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
I'm guessing this is a soho router and everthing is plugged directly in to it? Still the Ubuntu box _should_ not have a problem, as others have already said. As far as dhcp leases, when the Ubuntu client (Windows does this to) renews it's lease, it will ask for the same IP that it already has, so it will get the same IP even if the router is rebooted and loses it's dhcp table.

This could be a driver issue with the Ubuntu box. What NIC card do you have? I'm guessing this is an issue with the media state being changed to 'disconnected' and then not detecting the new media state when the router comes back and the link is reconnected. However, how much time are you giving it? In my experience, a linux box takes approximately 60 seconds to detect a new link state, whereas Windows is nearly instantaneous. This has to do with how often linux checks for a new link state and could be increased, but is set where it is so the computer doesn't waste a lot of time checking for reconnections.

Try waiting a minute and see if the Ubuntu box can talk to the network again after a router reboot.
 

konakona

Diamond Member
May 6, 2004
6,285
1
0
here is what I got from doing sudo /etc/init.d/networking restart:
root@printserver:/home/taiyaki# sudo /etc/init.d/networking restart
There is already a pid file /var/run/dhclient.eth0.pid with pid 32567
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth0/00:01:02:66:5d:87
Sending on LPF/eth0/00:01:02:66:5d:87
Sending on Socket/fallback
DHCPRELEASE on eth0 to 192.168.1.1 port 67
send_packet: Network is unreachable
send_packet: please consult README file regarding broadcast address.
There is already a pid file /var/run/dhclient.eth0.pid with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth0/00:01:02:66:5d:87
Sending on LPF/eth0/00:01:02:66:5d:87
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 18
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
There is already a pid file /var/run/dhclient.eth1.pid with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

SIOCSIFADDR: No such device
eth1: ERROR while getting interface flags: No such device
eth1: ERROR while getting interface flags: No such device
Bind socket to interface: No such device
There is already a pid file /var/run/dhclient.eth2.pid with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

SIOCSIFADDR: No such device
eth2: ERROR while getting interface flags: No such device
eth2: ERROR while getting interface flags: No such device
Bind socket to interface: No such device
There is already a pid file /var/run/dhclient.ath0.pid with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

SIOCSIFADDR: No such device
ath0: ERROR while getting interface flags: No such device
ath0: ERROR while getting interface flags: No such device
Bind socket to interface: No such device
There is already a pid file /var/run/dhclient.wlan0.pid with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

SIOCSIFADDR: No such device
wlan0: ERROR while getting interface flags: No such device
wlan0: ERROR while getting interface flags: No such device
Bind socket to interface: No such device

I forgot to mention earlier that I have some shared folders on winXP machines mounted on the ubuntu box through modifying fstab. Once the connection goes down, I noticed usb drive failed to mount also, although it was detected by the OS.

The router is linksys BEFSR41 ver 2.1, operated with dynamic routing. I usually come back upstairs to the living room where the linux box is located in no less than thirty minutes, so giving it enough time wont do much :( The only solution I found so far is to restart... bleh
 

Forsythe

Platinum Member
May 2, 2004
2,825
0
0
Originally posted by: VanillaH
here is what I got from doing sudo /etc/init.d/networking restart:
root@printserver:/home/taiyaki# sudo /etc/init.d/networking restart
There is already a pid file /var/run/dhclient.eth0.pid with pid 32567
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth0/00:01:02:66:5d:87
Sending on LPF/eth0/00:01:02:66:5d:87
Sending on Socket/fallback
DHCPRELEASE on eth0 to 192.168.1.1 port 67
send_packet: Network is unreachable
send_packet: please consult README file regarding broadcast address.
There is already a pid file /var/run/dhclient.eth0.pid with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth0/00:01:02:66:5d:87
Sending on LPF/eth0/00:01:02:66:5d:87
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 18
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
There is already a pid file /var/run/dhclient.eth1.pid with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

SIOCSIFADDR: No such device
eth1: ERROR while getting interface flags: No such device
eth1: ERROR while getting interface flags: No such device
Bind socket to interface: No such device
There is already a pid file /var/run/dhclient.eth2.pid with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

SIOCSIFADDR: No such device
eth2: ERROR while getting interface flags: No such device
eth2: ERROR while getting interface flags: No such device
Bind socket to interface: No such device
There is already a pid file /var/run/dhclient.ath0.pid with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

SIOCSIFADDR: No such device
ath0: ERROR while getting interface flags: No such device
ath0: ERROR while getting interface flags: No such device
Bind socket to interface: No such device
There is already a pid file /var/run/dhclient.wlan0.pid with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

SIOCSIFADDR: No such device
wlan0: ERROR while getting interface flags: No such device
wlan0: ERROR while getting interface flags: No such device
Bind socket to interface: No such device

I forgot to mention earlier that I have some shared folders on winXP machines mounted on the ubuntu box through modifying fstab. Once the connection goes down, I noticed usb drive failed to mount also, although it was detected by the OS.

The router is linksys BEFSR41 ver 2.1, operated with dynamic routing. I usually come back upstairs to the living room where the linux box is located in no less than thirty minutes, so giving it enough time wont do much :( The only solution I found so far is to restart... bleh

Bringing the interface down and bringing it back up will do it. I don't know how ubuntu does it though. And the reason it works with windows is that as soon as it looses connection, it sheds the ip, and dhcp's as soon as the connection is back up.
That is an addon for linux, dists. Look at the information about what to bring up and/or down.
In gentoo it's as simple as /etc/init.d/net.eth0 restart.
 

konakona

Diamond Member
May 6, 2004
6,285
1
0
6.10 (edgy)
the NIC is "3cSOHO100-TX Hurricane" according to the device manager.

I tried sudo ifdown eth0 / sudo ifup eth0 and got what nearly resembles what I copied and pasted last nite.
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
I would try ubuntu 6.06. You could use the 'desktop' liveCD to try it out and see if this problem exists. You could also try the 6.60 liveCD to see if this problem exists in a "clean" Ubuntu 6.10 environment.