[Netconf-devel] Re: About ifupdown on Debian

Thomas Hood jdthood@yahoo.co.uk
Tue, 19 Apr 2005 14:51:39 +0200


On Tue, 2005-04-19 at 13:37 +0200, G. Colangelo wrote:
> I've written a frontend for ifupdown in GTK that permit user's to choose
> their network profile easily.


Good idea.  You might want to look at netapplet, already packaged for
Debian, and "interapplet" at: 

   http://grahame.angrygoats.net/interapplet.shtml

Please join the netconf-devel mailing list if you are interested in
discussing possible future developments in Debian network configuration
tools.

   http://lists.alioth.debian.org/mailman/listinfo/netconf-devel



> I was thinking that such a tool can be useful for other people than me
> so i wrote to Anthony Towns about it.
> I got no reply, but after having a look at the ifupdown.deb's changelog,
> i've noticed that M Towns didn't seems to maintain the package anymore.


He has recently made a release.  However, it is true that he isn't the
most active maintainer.


> However, you made upload so i think that you can, perhaps, have a look
> to this tool


There are a few packaging flaws but we can discuss those some other
time.  I installed the package.  Here are my observations.

I get a window with the complete list of my logical interface
definitions in /etc/network/interfaces.  Beside each liface name are two
buttons, one labelled 'Details', the other labelled 'Stop' or 'Start'.

This doesn't really make sense.  ifup/ifdown does not operate on logical
interfaces; it operates on physical interfaces.

To make this clear by means of an example.  On my system there are
currently two physical interfaces, "lo" and "wlanp_0".  Suppose I define
three logical interfaces in /etc/network/interfaces: "lo", "home" and
"work".  Suppose I boot my system now.  The lo interface is brought up
at boot time by /etc/rcS.d/S40networking as logical interface lo.  (I
have physical interface "lo" listed on an "auto" line in /e/n/i.)  As a
result, /etc/network/run/ifstate contains the line "lo=lo" indicating
that physical interface "lo" has been configured as logical interface
"lo".  Now suppose I run "ifup wlanp_0=home-dhcp".  ifup configures
physical interface wlanp_0 using the information defined in logical
interface definition "home-dhcp"; it updates /etc/network/run/ifstate to
contain an additional line "wlanp_0=home-dhcp".

Now, a front end for ifupdown has to allow me to do the same thing.  The
only interfaces I can configure are the physical interfaces that are
present on my system, so a front end should only display those physical
interfaces[*].  Each such physical interface can be either deconfigured
or configured as exactly one of the logical interfaces defined
in /etc/network/interfaces, so a front end should display, for each
physical interface, a list of logical interfaces as which that physical
interface can be configured ... plus something like "Deconfigure".  Note
that not every logical interface is compatible with every physical
interface.

[*] This isn't entirely true.  Some logical interfaces create physical
interfaces in the process of being "applied", so to speak.  Suppose the
configuration commands or the "up" scripts defined in logical interface
"bar" result in the creation of physical interface "foo".  Then it is
quite possible to run "ifup foo=bar" and get physical interface "foo",
configured as logical interface "bar".  Clearly, a front end should list
"foo" as another physical interface that could be brought up.  However,
unlike the physical interfaces mentioned earlier which are listed
in /proc/net/dev, created-while-configured interfaces are not listed
in /proc/net/dev before they are configured.  The convention is to name
the created physical interface on a special "creates" option line in the
logical interface stanza in question.  Thus, a front end should list as
available physical interfaces both those named in /proc/net/dev and
those named on "creates" lines.  Of course, if "foo" is a
created-while-configured interface then the only logical interface as
which it can be configured is the one that creates it.

In the gifupdown window I click on the "Details" button beside
"home-dhcp".  A new window pops up.  The text in the window is a correct
description of the home-dhcp logical interface definition except for the
"Interface" field which contains "home".  There is no such interface on
my system.  What I have is a physical interface named "wlanp_0"
configured as a logical interface named "home-dhcp".  This information
is easily available to gifupdown in /etc/network/run/ifstate on the
line:

     wlanp_0=home-dhcp

HTH.
-- 
Thomas Hood <jdthood@yahoo.co.uk>