riedochs
13.02.10, 19:48
Hallo zusammen,
ich habe meinem Server heute weitere NIC spendiert und habe jetzt folglich das Problem das nun die Netzwerkkarten durcheinander gewürfelt sind. Kann ich die MAC Adressen fest eth0 bis eth2 zuordnen?
OS ist Debian Lenny. Verbaute NIC sind: Onboard, NIC1 (PCIe), NIC2 (PCI)
Google hat mir das hier ausgespuckt:
1.4. Zuordnungen Karte 1 -> eth0 , Karte 2 -> eth1 tauschen (Debian)
hat man ein System sauber aufgesetzt ( Firewall, Proxy, .... ) sind überall die Aliases eth0 usw. einer bestimmten Netzwerkkarte zugeordnet. Ändert man nun die Karte ( steckt andere Reihenfolge im PC) ändern sich möglicher Weise die Zuordnungen. Abhilfe: dezidierte Zuordnung 1 erstelle /etc/mactab editiere die Zusammenhänge Mac-Adresse -> Aliases Bsp:
eth2 00:12:79:5E:D1:63 # normale Zuordnung =eth0
eth1 00:0E:2E:29:B0:AE # normale Zuordnung =eth2
eth0 00:0E:2E:2A:2F:7E # normale Zuordnung =eth1
Netzwerk niederfahren (ifdown -a oder /etc/init.d/networking stop ) mit nameif Zuordnung im Kernel ändern Netzwerk wieder hochfahren (ifup -a oder /etc/init.d/networking start) Zuordnung ist nicht permanent
eventuell im Startupscript Starten von //nameif// eintragen dazu im /etc/init.d/networking unter start, stop, restart //nameif// aufrufen
start)
doopt spoofprotect yes
doopt syncookies no
doopt ip_forward no
echo -n "Configuring network interfaces..."/
''Möglichkeit 1''
nameif #uses default /etc/mactab to change ethernet-interfaces
**Möglichkeit 2**
* statt der oben genannten Zeile UND mactab gleich die richtigen MAC-Adressen zu den Interfaces angeben in start, und restart Abschnitt !
# /sbin/nameif -s eth2 00:50:da:08:f0:4a # 3COM: set to eth2
# /sbin/nameif -s eth1 00:40:05:45:19:22 # Linksys: set to eth1
# /sbin/nameif -s eth0 00:50:da:08:f0:4a # 3COM: set to eth0
ifup -a
Quelle: http://linuxwiki.de/NetzwerkKonfiguration#Zuordnungen_Karte_1_-.3E_eth0_.2C_Karte_2_-.3E_eth1_tauschen_.28Debian.29
Nur dummerweise sieht meine /etc/init.d/networking anders aus:
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: networking
# Required-Start: mountkernfs ifupdown $local_fs
# Required-Stop: ifupdown $local_fs
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Raise network interfaces.
### END INIT INFO
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
[ -x /sbin/ifup ] || exit 0
. /lib/lsb/init-functions
process_options() {
[ -e /etc/network/options ] || return 0
log_warning_msg "/etc/network/options still exists and it will be IGNORED! Read README.Debian of netbase."
}
check_network_file_systems() {
[ -e /proc/mounts ] || return 0
exec 9<&0 < /proc/mounts
while read DEV MTPT FSTYPE REST; do
case $DEV in
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
log_warning_msg "not deconfiguring network interfaces: network devices still mounted."
exit 0
;;
esac
case $FSTYPE in
nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs| pvfs2|fuse.httpfs|fuse.curlftpfs)
log_warning_msg "not deconfiguring network interfaces: network file systems still mounted."
exit 0
;;
esac
done
exec 0<&9 9<&-
}
case "$1" in
start)
process_options
log_action_begin_msg "Configuring network interfaces"
if ifup -a; then
log_action_end_msg $?
else
log_action_end_msg $?
fi
;;
stop)
check_network_file_systems
log_action_begin_msg "Deconfiguring network interfaces"
if ifdown -a --exclude=lo; then
log_action_end_msg $?
else
log_action_end_msg $?
fi
;;
force-reload|restart)
process_options
log_action_begin_msg "Reconfiguring network interfaces"
ifdown -a --exclude=lo || true
if ifup -a --exclude=lo; then
log_action_end_msg $?
else
log_action_end_msg $?
fi
;;
*)
echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
Muss ich die Zeile aus Möglichkeit 1 nach den IF-Blöcken einfügen? Möglichkeit 2 verstehe ich überhaupt nicht.:confused:
Meine interfaces sieht so aus:
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
auto eth1
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.254
face eth1 inet static
address 192.168.0.30
netmask 255.255.255.0
gateway 192.168.0.254
eth0 soll die PCIe Karte werden, eth1 soll die onboard werden. Die PCI bleibt vorerst unkonfiguriert.
Danke euch im Vorraus für eure Hilfe.
ich habe meinem Server heute weitere NIC spendiert und habe jetzt folglich das Problem das nun die Netzwerkkarten durcheinander gewürfelt sind. Kann ich die MAC Adressen fest eth0 bis eth2 zuordnen?
OS ist Debian Lenny. Verbaute NIC sind: Onboard, NIC1 (PCIe), NIC2 (PCI)
Google hat mir das hier ausgespuckt:
1.4. Zuordnungen Karte 1 -> eth0 , Karte 2 -> eth1 tauschen (Debian)
hat man ein System sauber aufgesetzt ( Firewall, Proxy, .... ) sind überall die Aliases eth0 usw. einer bestimmten Netzwerkkarte zugeordnet. Ändert man nun die Karte ( steckt andere Reihenfolge im PC) ändern sich möglicher Weise die Zuordnungen. Abhilfe: dezidierte Zuordnung 1 erstelle /etc/mactab editiere die Zusammenhänge Mac-Adresse -> Aliases Bsp:
eth2 00:12:79:5E:D1:63 # normale Zuordnung =eth0
eth1 00:0E:2E:29:B0:AE # normale Zuordnung =eth2
eth0 00:0E:2E:2A:2F:7E # normale Zuordnung =eth1
Netzwerk niederfahren (ifdown -a oder /etc/init.d/networking stop ) mit nameif Zuordnung im Kernel ändern Netzwerk wieder hochfahren (ifup -a oder /etc/init.d/networking start) Zuordnung ist nicht permanent
eventuell im Startupscript Starten von //nameif// eintragen dazu im /etc/init.d/networking unter start, stop, restart //nameif// aufrufen
start)
doopt spoofprotect yes
doopt syncookies no
doopt ip_forward no
echo -n "Configuring network interfaces..."/
''Möglichkeit 1''
nameif #uses default /etc/mactab to change ethernet-interfaces
**Möglichkeit 2**
* statt der oben genannten Zeile UND mactab gleich die richtigen MAC-Adressen zu den Interfaces angeben in start, und restart Abschnitt !
# /sbin/nameif -s eth2 00:50:da:08:f0:4a # 3COM: set to eth2
# /sbin/nameif -s eth1 00:40:05:45:19:22 # Linksys: set to eth1
# /sbin/nameif -s eth0 00:50:da:08:f0:4a # 3COM: set to eth0
ifup -a
Quelle: http://linuxwiki.de/NetzwerkKonfiguration#Zuordnungen_Karte_1_-.3E_eth0_.2C_Karte_2_-.3E_eth1_tauschen_.28Debian.29
Nur dummerweise sieht meine /etc/init.d/networking anders aus:
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: networking
# Required-Start: mountkernfs ifupdown $local_fs
# Required-Stop: ifupdown $local_fs
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Raise network interfaces.
### END INIT INFO
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
[ -x /sbin/ifup ] || exit 0
. /lib/lsb/init-functions
process_options() {
[ -e /etc/network/options ] || return 0
log_warning_msg "/etc/network/options still exists and it will be IGNORED! Read README.Debian of netbase."
}
check_network_file_systems() {
[ -e /proc/mounts ] || return 0
exec 9<&0 < /proc/mounts
while read DEV MTPT FSTYPE REST; do
case $DEV in
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
log_warning_msg "not deconfiguring network interfaces: network devices still mounted."
exit 0
;;
esac
case $FSTYPE in
nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs| pvfs2|fuse.httpfs|fuse.curlftpfs)
log_warning_msg "not deconfiguring network interfaces: network file systems still mounted."
exit 0
;;
esac
done
exec 0<&9 9<&-
}
case "$1" in
start)
process_options
log_action_begin_msg "Configuring network interfaces"
if ifup -a; then
log_action_end_msg $?
else
log_action_end_msg $?
fi
;;
stop)
check_network_file_systems
log_action_begin_msg "Deconfiguring network interfaces"
if ifdown -a --exclude=lo; then
log_action_end_msg $?
else
log_action_end_msg $?
fi
;;
force-reload|restart)
process_options
log_action_begin_msg "Reconfiguring network interfaces"
ifdown -a --exclude=lo || true
if ifup -a --exclude=lo; then
log_action_end_msg $?
else
log_action_end_msg $?
fi
;;
*)
echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
Muss ich die Zeile aus Möglichkeit 1 nach den IF-Blöcken einfügen? Möglichkeit 2 verstehe ich überhaupt nicht.:confused:
Meine interfaces sieht so aus:
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
auto eth1
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.254
face eth1 inet static
address 192.168.0.30
netmask 255.255.255.0
gateway 192.168.0.254
eth0 soll die PCIe Karte werden, eth1 soll die onboard werden. Die PCI bleibt vorerst unkonfiguriert.
Danke euch im Vorraus für eure Hilfe.