>-----Original Message----- >From: steve [mailto:st...@greengecko.co.nz] >Sent: Monday, 24 August 2009 6:58 p.m. >To: linux-users@it.canterbury.ac.nz >Subject: RE: Networking - equivalent of windows 'alternate configuration' >setting? > >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 >
Thanks Steve - I'll try it out but it won't be till later in the week now. It's good to see some example of how to script it. I'll let you know how I get on. Regards, Bryce. DISCLAIMER: If you have received this email in error, please notify us immediately by reply email, facsimile or collect telephone call to +64 3 9641200 and destroy the original. Please refer to full DISCLAIMER at http://www.hrnz.co.nz/eDisclaimer.htm