Skip to contentSkip to conversation

The magical mystical changing ethernet interface order

DISCUSSION Ray Lee 3 participants 3 messages May 8, 2003 – May 9, 2003

lore
Share & tools
lore

Ray Lee

author
#0 lore raw
Quoted 3 lines · Jean Tourrilhes

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

#1 lore raw

Ray Lee <[email protected]> wrote:

| 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

I just do:

	auto  net
	iface net inet static
		pre-up    nameif net 00:00:C0:4F:8B:F6  
		...

	auto  lan
	iface lan inet static
		pre-up    nameif lan 00:60:B0:EC:92:F9  
		...
Signature · 3 lines
Dick Streefland                      ////                      Altium BV
[email protected]           (@ @)          http://www.altium.com
--------------------------------oOO--(_)--OOo---------------------------
#2 lore raw
In reply to Ray Lee

Hello Ray & All , While that RedHat/Debian/... have figured these out is really nice . NOT one of those methods appears to be available for hand built distros . Ie: there does not appear to be a standardised(tm) method to approach this difficulty through out all drivers (not just ethernet) .

Could someone please point me to NON RedHat/Debian/... centric tool to determine the proper ethernet for now ?

Modules are not an option for me here . Imo: If this can be done with modules it should well be possible for staticly built drivers as well . Tia , JimL

Quoted 29 lines · Ray Lee
Quoted 3 lines · Jean Tourrilhes

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

Signature · 5 lines
       +------------------------------------------------------------------+
       | James   W.   Laferriere | System    Techniques | Give me VMS     |
       | Network        Engineer |     P.O. Box 854     |  Give me Linux  |
       | [email protected] | Coudersport PA 16915 |   only  on  AXP |
       +------------------------------------------------------------------+