D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Router problem - maybe not.

 

Neil Winchurst wrote:
> On Tue, 05 Sep 2006 13:57:04 +0100
> Neil Williams <linux@xxxxxxxxxxxxxx> wrote:
> I have now found /etc/sysconfig/network-scripts/ifcg-eth0
> Here is a copy of the contents
> 
> DEVICE=eth0
> BOOTPROTO=dhcp
> NETMASK=255.255.255.0
> NETMASK=255.255.255.0
> DHCP_CLIENT=dhclient

OK. That's what was needed (although why NETMASK appears twice is a
mystery best kept to Mandriva).

> As far as I can see nothing is still working, just as though I have the
> router switched off. Once I reboot the router everything is working OK.

Your DHCP lease is stale - the PC, for whatever reason, is trying to use
the same DHCP settings AFTER a reboot that it used before. That may work
if the reboot is quite quick but if you shutdown and then restart some
time later, it is definitely the wrong thing to do.

I suspect your DHCP configuration in Mandriva is wrong - it sounds like
it's not looking for a new DHCP "lease" at boot.

If this happens again when you next restart, please run:
$ dmesg | grep dhcp
before you do anything else and post any output once you are back online.

> I have now found /etc/resolve.conf which contains just one line
> 
> nameserver 192.168.1.1

Is that the IP of the router?

Try:
$ host mygateway.ar7

$ dig -x 192.168.1.1

>>>> If you set your local DNS on the router, the IP address of the router
>>>> should be your nameserver. If you run bind on the PC, the nameserver IP
>>>> should be the static IP of the PC.
>>>>
>>> I don't understand all that. The router was set up for me. All I did
>>> was plug it in to the computer and it worked.

Then you are relying on the router passing correct information for these
settings AND on the PC requesting that data at boot. It looks like your
machine isn't trying to get fresh data from the router at boot, instead
it's trying to use stale data.

Presumably you don't have specific hostnames for each machine on the
network? That makes it hard to connect to another machine on the same
LAN because you first have to find out the IP address which changes each
time the DHCP lease is renewed.

DHCP is the default config of Windows boxes and therefore all routers
will "silently" support DHCP and "just work". That does not mean that
DHCP is automatically the best solution for your network usage! What's
good for MS is not really best for you (or you wouldn't be on a
GNU/Linux user group mailing list!).

Most "useful" or "serious" local network usage is easier with static IP
addresses and a local DNS. This allows you to setup one machine as a
local webhost, another to serve email or files or act as a print server
etc. These things get increasingly difficult if the IP address keeps
changing with DHCP.

I use DHCP only for:
  1. internet connections (i.e. the bit between the router and my
        ISP, not me and the router).
  2. LUG meetings or other "spontaneous" / short-lived networks.

>> Try:
>> # /etc/init.d/dhcpd restart
>> (or equivalent on Mandriva)
>>
> I have searched for dhcpd  - result
> 
> /usr/share/doc/dhcp-common-3.0.3/contrib/dhcpd-conf-to-ldap.pl
> /usr/share/doc/dhcp-common-3.0.3/doc/dhcp-dynamic-dns-examples/dhcp/etc/dhcpd.conf
> /usr/share/setup-tool-backends/scripts/dhcpd-conf
> /usr/share/setup-tool-backends/scripts/dhcpd.pl
> /usr/lib/libDrakX/network/dhcpd.pm

I forget where the init scripts were in Mandrake but you should find
something in /etc/rc.5/ or /etc/rc.d/ - these are the scripts that are
run at boot time to start up all the services used by that machine.

One of those scripts needs to run dhcpd at boot time - this is the
program that will negotiate a new lease from the router.

>> Instead of rebooting the router, next time try these commands on the PC:
>>
>> # ifdown eth0
>> # ifup eth0

> OK, I will try that and see what happens.

I expect this will solve your problems because it forces the machine to
request a new DHCP lease - basically your DHCP config is "leased" to
your machine for a finite amount of time, after which it must be
renewed. This renewal appears to be failing at boot (when the time
period would normally have lapsed). The problem is almost certainly in
the config of your machine, not the router.

> This time I turned off the router first, then I booted up the computer
> and once it was running I restarted the router. Once it had settled
> down I tried to download my emails and everything was fine.

Leave the router alone, that's my advice. There's nothing wrong with it,
the problem is in your Mandriva machine. Check out your dhcpd setup and
make sure it's being run at boot (via dmesg).

Better still, leave the machine running and just logout when you aren't
using it. Saves all the time wasted waiting for the boot to complete.
Invest in a UPS if you're concerned about powercuts.

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


Attachment: signature.asc
Description: OpenPGP digital signature

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html