Re: Thoughts on network detection and configuration on Debian
On Thu, Dec 06, 2001 at 04:41:20PM +0100, firstname.lastname@example.org wrote:
> * Thoughts on network detection and configuration on Debian
> There are a lot of packages for automatic network detection and
> reconfiguration on debian: whereami, divine, intuitively,
> laptop-netconf, laptop-net, netenv and maybe others. IMHO they all have
> a problem: they do network detection AND reconfiguration. This is a
> problem because Debian already has a way to configure network
> interfaces, provided by the base package ifupdown.
> ifupdown already provides a way to define configuration profiles, and
> hooks for selecting the good one. This means that Debian does not need
> a unique tool for network detection AND reconfiguration, but two
> different tools, one for network detection and one for system
Ifupdown would also need to be triggered on APM suspend/resume events to
reconfigure when a laptop wakes up in a new location. Could that be done?
The ifupdown part is only really a part of the big picture for laptop
reconfiguration. Even ifupdown is, in a way, yet another combination of the
detection and reconfiguration steps. It does some things well, others not
so well. Some of the packages in Debian use it, others do not, generally
because they are trying not to be Debain-specific.
I'll try and go through the different steps in the procedure, and look at
what is done to handle them. I use whereami, so sorry if I miss something
out from the others.
The detection process should be started when one of these events occur:
- at boot-time
- hardware, such as a PCMCIA card is added/removed
- APM or ACPI suspend/resume event
- a network cable is plugged in
Each package supports a different combination of events. No package
provides all possibilities out of the box.
Detection flow of control
Some packages treat each interface seperately for detection as ifupdown
does, others do the detection all in one go. I guess generally it is
possible to treat each interface seperately, since usually only one
interface at a time will be active. But maybe someone is doing something
Most detection methods boil down to doing ARP pings to different machines to
see if they respond. netenv doesn't even do that - it displays a dialog at
boot time and asks you to choose a location. laptop-net is started from the
command line with a given scheme name.
I decided to use whereami because it can also configure based on an address
received by DHCP. I have also added a pppoe detection script for when I am
on a DSL line.
Reconfiguration - network
Network configuration inolves setting up IP addresses, default gateway,
routes, DNS etc. ifupdown has easy ways for setting the IP address and
gateway, but more advanced configuration such as DNS setup is not provided.
See the last section for a discussion.
Reconfiguration - services
When moving around, various services may need to be started or stopped. For
example, fetchmail should only run when on a network with a permanent
internet connection. Most packages leave that up to the user to script.
laptop-net has a more intricate solution.
Reconfiguration - software
Your DNS servers may need to be changed, or your proxy server, or your SMTP
delivery method, etc. Some packages provide an automatic way of moving new
files in place, such as a new resolv.conf. This means however that you must
start maintaining several copies of configuration files. So every time you
tweak your MTA config, you have to update all other copies etc. etc...
Whereami is building up a reconfiguration script library, for operations
such as changing MTA configuration, proxy configuration and so on. It would
be really useful if we could pool these together so everyone can use them,
rather than each package writing their own.
Another thing I would like to see is the ability to group common actions
together, such as the tasks which are always performed when connected to the
internet, or when I arrive at different subnets on the same network. There
is very little support for this directly in the config files - you usually end
up having to write a seperate script and call that.
All we have to do now is integrate them all togetheri! I'm for extending
whereami, but I was busy helping do that already :)
Chris Halls | Frankfurt, Germany