Re: [Hampshire] dhcp for wireless and static ethernet on Ubu…

Top Page
Author: Hugo Mills
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] dhcp for wireless and static ethernet on Ubuntu

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x58293100.hantslug.org.uk.30448': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Thu Nov 23 11:40:06 2006 GMT
gpg: using DSA key B2C27BC21C335860
gpg: Can't check signature: No public key
On Thu, Nov 23, 2006 at 10:28:37AM +0000, John Hunt wrote:
> I've recently been given a static IP address for our LAN here at our
> dept. at the university, this is because I was being assigned an
> address/gateway/dns via the unveristy's dhcp server which was fine,
> but recently the university's dhcp assigned gateway has been dropping
> packets etc.. and is generally a long way around to get to servers and
> other machines in my office.
>
> I use a laptop which I like to take to and from work every day. At
> home I use a wireless router which assigns addresses via DHCP. I don't

[snip]
> Ultimately, what I'd like to do is get rid of networkmanager (or find
> a version that supports static IPs etc) and just use the old non-gnome
> /etc/network/interfaces file as that seems to make the most sense to
> me. I'd also like for one interface not to intefere with the other
> when it's not in use.
>
> Does anyone use their laptop in a similar way, or know what I should
> do? I'd quite like to keep networkmanager on my system for times when
> I want to quickly access a wireless network.


As John Lewis says, /etc/network/interfaces is your friend. I
had/have such a configuration on my old laptop. Basically, you need a
script to find out where you are (mine uses "iwlist scan", and scans
through the output for wireless networks it knows about -- mine, one
of several at work, my parents'). This script can be used as a mapping
script in the interfaces file, to select one of multiple iface
stanzas.

A more sophisticated thing you can do is write a script (attached
to a hot-key, if you can do it) which can use mii-tool to detect
whether you have a cable attached to eth0. This script can then cycle
round through (no config, wireless), or (no config, wired, wireless),
depending on whether the wired network is active. When I get home
tonight, I'll dig my scripts out for you.

Hugo.

--
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
PGP key: 1C335860 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
--- Charting the inexorable advance of Western syphilisation... ---