[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Debian] Zwei Karten



On Tue, 3 Oct 2000 20:57:10 +0200, Jens Müller <jens@unfaehig.de>
wrote:
>Ja, sind zwei PCI-Karten mit RTL8139. Ich habe nur Angst, daß er die wahllos vertauscht
>und das lokale Netz plötzlich an eth1 hängt und das DSL-Modem an eth0, obwohl es andersrum
>konfiguriert war. Wie gesagt, wenn das einmal nach dem Reinstecken passiert, kann man die
>beiden Kabel vertauschen, aber wenn er das bei jedem Booten u.U. ändert, wäre das nicht so
>toll.

|mh@torres[1/500]:~$ cat /usr/sbin/checkhwaddr
|#!/bin/bash
|
|# verifies if interface $1 has actually MAC address $2.
|
|# this is intended to be called from /etc/network/interfaces in a pre-up
|# command. Unfortunately, pre-up's return codes seem to be ignored at the
|# moment, so we don't have a chance to take down the interface if miscon-
|# figuration has been detected. This should be changed in a future version
|# of ifupdown, and the maintainer has been informed about this.
|
|mac=`macofif $1 | tr '[:lower:]' '[:upper:]'`
|iface="$1"
|compmac=`echo $2 | tr '[:lower:]' '[:upper:]'`
|
|if [ ! "$compmac" = "$mac" ]; then
|  echo "ERR: Interface $iface has MAC address $mac. verification against $compmac failed." >&2
|  logger -t ifupdown "ERR: Interface $iface has MAC address $mac. verification against $compmac failed."
|  exit 1
|fi
|mh@torres[2/501]:~$ cat /usr/sbin/macofif
|#!/bin/sh
|#
|# macofif       Determines the MAC address of the interface given on the
|#               commandline
|#               If interface given has no MAC address (for example a ppp
|#               device), no output is generated
|#
|# v1.0  19 July 1998
|#####
|
|/sbin/ifconfig $1 | grep '[Hh][Ww]addr' | \
|  sed 's/.*[Hh][Ww]addr *\(\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}\).*/\1/'
|mh@torres[3/502]:~$ less /etc/network/interfaces
|# We always want the loopback interface. Whether we want ifup/ifdown to
|# know about is another matter, perhaps.
|#
|iface lo inet loopback2
|        up maintstate up lo LO LO
|        up ip route add 127.0.0.0/8 dev lo
|        down ip route del 127.0.0.0/8 dev lo
|        down maintstate down lo
|
|iface ce06e inet static2
|     address 212.126.206.6/29
|     broadcast 212.126.206.7
|     gateway 212.126.206.1
|     hwiface unt0
|     pre-up renif --idempotent eth0 unt0
|     pre-up checkhwaddr unt0 00:00:E8:DF:07:78
|     up maintstate up ce06e UNTRce06e UNTR
|     down maintstate down ce06e
|
|iface 82018 inet static2
|     address 192.168.130.1/24
|     broadcast 192.168.130.255
|     hwiface int0
|     pre-up renif --idempotent eth1 int0
|     pre-up checkhwaddr int0 00:00:E8:6C:D0:9B
|     up maintstate up 82018 TRST82018 TRST
|     down maintstate down 82018
|mh@torres[4/503]:~$

static2 ist eine private Erweiterung; checkhwaddr sollte aber genauso
mit konventioneller static-Konfiguration funktionieren.

So kannst Du die Netzwerkkarten auf den Slotblechen markieren, und es
ist sichergestellt, daß die Zuordnung zwischen physikalischem und
logischem Interface entweder stimmt oder das Interface nicht
hochgefahren wird. Aufpassen mußt Du nur, wenn Du Netzwerkkarten
_tauschst_.

Grüße
Marc

-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber          |   " Questions are the         | Mailadresse im Header
Karlsruhe, Germany  |     Beginning of Wisdom "     | Fon: *49 721 966 32 15
Nordisch by Nature  | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29

---------------------------------------------------------
Um sich aus der Liste auszutragen schicken Sie bitte eine
E-Mail an debian-user-de-request@lehmanns.de die im Body
"unsubscribe <deine_email_adresse>" enthaelt.
Bei Problemen bitte eine Mail an: Jan.Otto@Lehmanns.de
---------------------------------------------------------

789 eingetragene Mitglieder in dieser Liste.



Reply to: