On Mon, 2009-08-24 at 15:02 +1200, bryce wrote: > ... I've got to stop hitting Ctrl-enter for line breaks like I do in > my programming editor -- sends email instead ... anyway: > > >-----Original Message----- > >From: steve [mailto:st...@greengecko.co.nz] > >Sent: Monday, 24 August 2009 11:03 a.m. > > >To set up your dhcp server, something like... > > Dhcp is done either on Windows servers, or my adsl router at home. > > > > > >lease { > > interface "eth0"; > > fixed-address 203.97.9.110; > > option subnet-mask 255.255.255.0; > My mask is 255.255.255.248 - this shouldn't mess with it should it? > > > option routers 203.97.9.105; > > option domain-name-servers 203.97.33.14, 203.97.37.14; > > renew 0 2030/12/31 23:59:59; > > rebind 0 2030/12/31 23:59:59; > > expire 0 2030/12/31 23:59:59; > >} > [snip]
Hmmm... I thought it should've picked up the local lease, although I see it's the network manager that's disabling it. As an alternative approach, you could add a new hook script into /etc/dhcp3/dhclient-exit-hooks.d - call it dhcptimeout for example -- 8< snip -- #!/bin/bash case "$reason" in TIMEOUT|FAIL) /sbin/ifconfig eth0 203.97.9.110 netmask 255.255.255.248 up echo "search your.domain nameserver 203.97.33.14 nameserver 203.97.37.14" > /etc/resolv.conf /sbin/route add default gw 203.97.9.105 ;; esac -- 8< snip -- (this script is completely untested btw! and change for the correct domain name ). It'll be interesting to see what the network manager thinks of that. You may well be able to make this script a lot more generic, there's a lot of variables set up. Try enabling the debug exit script if it's there. If not, use the following: -- 8< snip -- for i in reason interface medium alias_ip_address new_ip_address \ new_subnet_mask new_domain_name \ new_domain_name_servers new_routers new_static_routes \ old_ip_address old_subnet_mask old_domain_name \ old_domain_name_servers old_routers \ old_static_routesq do echo $i=\'${!i}\' done > /tmp/dhclient.debug -- 8< snip -- You may need to set $reason to "BOUND" on exit to shut the network manager up... Cheers, Steve -- Steve Holdoway <st...@greengecko.co.nz> http://www.greengecko.co.nz MSN: st...@greengecko.co.nz GPG Fingerprint = B337 828D 03E1 4F11 CB90 853C C8AB AF04 EF68 52E0
signature.asc
Description: This is a digitally signed message part