Skip to contentSkip to conversation

The magical mystical changing ethernet interface order

DISCUSSION Thomas Hood 1 participant 1 message May 10, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 7 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.

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.)

Quoted 11 lines

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

Signature · 1 line
Thomas Hood <[email protected]>