linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: The magical mystical changing ethernet interface order
@ 2003-05-08 19:32 Jean Tourrilhes
  2003-05-08 21:43 ` Eli Carter
  2003-05-08 21:46 ` Alan Cox
  0 siblings, 2 replies; 26+ messages in thread
From: Jean Tourrilhes @ 2003-05-08 19:32 UTC (permalink / raw)
  To: Linux kernel mailing list, Russell King; +Cc: Randy.Dunlap, Jeff Garzik

Russell King wrote :
> 
> Does anyone know if there's a reason that the ethernet driver initialisation
> order has changed again in 2.5?
>
> Its rather annoying when your dhcpd starts on the wrong interface.

David S. Miller wrote
> Any reliance on link ordering is broken and needs to be fixed.

	I fully agree with David, this problem goes beyond the link
order.
	Since 97, I've been figthing this issue with my laptop. I've
got various Pcmcia card (Ethernet and Wireless), as well as PCI and
ISA Ethernet cards in the docking station. Depending on which
configuration the laptop is started in, eth0 could be any Pcmcia card
or any ISA/PCI card in the docking station.
	With USB in the picture, things are even more dynamic. And no
careful kernel link order mechanism will ensure that eth0 is the same
device.
	So, let's get rid of the link order "fix", because this
address only a small subset of the problem. Let's fix the real problem
which is that eth0 can't map any specific hardware device, and the
device name is totally arbitrary and meaningless.

Randy.Dunlap wrote :
> An alternative is to use 'nameif' to associate MAC addresses with
> interface names.  See here for mini HOWTO:
> 
>   http://www.xenotime.net/linux/doc/network-interface-names.txt

	Currently this feels like a kludge, because not fully
inegrated, but goes in the right direction.
	Actually, it's pretty funny that the original Pcmcia package
got it right since the beggining (and Win2k as well), but
distributions took a step backward from that when integrating Pcmcia.
	My belief is that configuration scripts should be specified in
term of MAC address (or subset) and not in term of device name. Just
like the Pcmcia scripts are doing it.
	And let's go the extra mile : ifconfig should accept a MAC
address as the argument instead of a device name. And in the long
term, just get rid of device name from the user view.

	Have fun...

	Jean


^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: The magical mystical changing ethernet interface order
@ 2003-05-10  7:42 Thomas Hood
  0 siblings, 0 replies; 26+ messages in thread
From: Thomas Hood @ 2003-05-10  7:42 UTC (permalink / raw)
  To: linux-kernel

Ray Lee wrote:
> Jean Tourrilhes wrote:
>>         My belief is that configuration scripts should be specified in
>> term of MAC address (or subset) and not in term of device name. Just
>> like the Pcmcia scripts are doing it.
>
> Debian already supports this, integrated into the normal scheme for
> dealing with interfaces.

Yes.  Note that the names 'lan' and 'internet' in the example
are name of possible configurations, not "physical" interface names.
They are only used by the ifupdown package; they do not show up
in an "ifconfig" listing.  Thus, doing "ifup eth0=home-wireless-1"
brings up interface eth0 in the home-wireless-1 configuration.
What implements the ability to work in terms of MAC addresses is the
mapping script /path/to/get-mac-addr.sh.  When, e.g., eth0 comes up,
get-mac-addr.sh scans for the MAC address and outputs either the
name 'lan' or the name 'internet'; ifupdown then configures eth0
with either the "lan" configuration or the "internet" configuration.

(The configurations are called "logical interfaces" in the ifupdown
documentation.)

>	auto eth0 eth1
>	mapping eth0 eth1
>		script /path/to/get-mac-addr.sh
>		map 11:22:33:44:55:66 lan
>		map AA:BB:CC:DD:EE:FF internet
>	iface lan inet static
>		address 192.168.42.1
>		netmask 255.255.255.0
>		pre-up /usr/local/sbin/enable-masq $IFACE
>	iface internet inet dhcp
>		pre-up /usr/local/sbin/firewall $IFACE

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


^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: The magical mystical changing ethernet interface order
@ 2003-05-08 23:38 Ray Lee
  2003-05-09 12:41 ` Dick Streefland
  2003-05-09 14:33 ` Mr. James W. Laferriere
  0 siblings, 2 replies; 26+ messages in thread
From: Ray Lee @ 2003-05-08 23:38 UTC (permalink / raw)
  To: jt, Linux Kernel

Jean Tourrilhes wrote:
>         My belief is that configuration scripts should be specified in
> term of MAC address (or subset) and not in term of device name. Just
> like the Pcmcia scripts are doing it.

Debian already supports this, integrated into the normal scheme for
dealing with interfaces. Anyone running Debian can take a look at
/usr/share/doc/ifupdown/examples directory, the network-interfaces.gz
file contains sample /etc/network/interfaces stanzas for configuring
your interfaces via MAC address:

	auto eth0 eth1
	mapping eth0 eth1
		script /path/to/get-mac-addr.sh
		map 11:22:33:44:55:66 lan
		map AA:BB:CC:DD:EE:FF internet
	iface lan inet static
		address 192.168.42.1
		netmask 255.255.255.0
		pre-up /usr/local/sbin/enable-masq $IFACE
	iface internet inet dhcp
		pre-up /usr/local/sbin/firewall $IFACE

You can even do something like:

	iface wireless inet dhcp
		wireless_key 12345678901234567890123456

A sample get-mac-address.sh is in the same directory, though it has a
typo (missing a close paren -- I need to report that...). This same
scheme works for pinging some well-known host to determine where you
are, or using ARPs, or whatever. I use it on my laptop with PCMCIA
cards, works great.

Ray


^ permalink raw reply	[flat|nested] 26+ messages in thread
* The magical mystical changing ethernet interface order
@ 2003-05-07 13:14 Russell King
  2003-05-07 15:18 ` Dick Streefland
  2003-05-07 15:24 ` Randy.Dunlap
  0 siblings, 2 replies; 26+ messages in thread
From: Russell King @ 2003-05-07 13:14 UTC (permalink / raw)
  To: Linux Kernel List

Does anyone know if there's a reason that the ethernet driver initialisation
order has changed again in 2.5?

In 2.2.xx, we had eth0 = NE2000, eth1 = Tulip
In 2.4, we have eth0 = Tulip, eth1 = NE2000
And in 2.5, it's back to eth0 = NE2000, eth1 = Tulip

Both interfaces are on the same bus:

00:0a.0 Ethernet controller: Digital Equipment Corporation DECchip 21142/43 (rev 30)
00:0d.0 Ethernet controller: Winbond Electronics Corp W89C940F

Its rather annoying when your dhcpd starts on the wrong interface.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2003-05-11 18:28 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-08 19:32 The magical mystical changing ethernet interface order Jean Tourrilhes
2003-05-08 21:43 ` Eli Carter
2003-05-08 22:19   ` Jean Tourrilhes
2003-05-08 21:46 ` Alan Cox
2003-05-08 23:23   ` Randy.Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2003-05-10  7:42 Thomas Hood
2003-05-08 23:38 Ray Lee
2003-05-09 12:41 ` Dick Streefland
2003-05-09 14:33 ` Mr. James W. Laferriere
2003-05-07 13:14 Russell King
2003-05-07 15:18 ` Dick Streefland
2003-05-07 15:38   ` Jeff Garzik
2003-05-07 15:24 ` Randy.Dunlap
2003-05-07 17:14   ` Russell King
2003-05-07 22:04     ` Andrew Morton
2003-05-07 22:28       ` Dave Hansen
2003-05-08 12:05         ` David S. Miller
2003-05-08 14:55           ` Alan Cox
2003-05-08 14:54             ` David S. Miller
2003-05-08 16:24               ` Arnaldo Carvalho de Melo
2003-05-08 16:26               ` Jeff Garzik
2003-05-08 16:30                 ` Randy.Dunlap
2003-05-11 18:41                   ` Jeff Garzik
2003-05-08 17:56               ` Kai Germaschewski
2003-05-08 17:36           ` Linus Torvalds
2003-05-09  6:51           ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).