ethtool
mii-diag
(Paket netdiag)mtr
ist ein netter der Ersatz für ping und traceroute … 1)
mit mtr zieladresse
wird ein sich ständig aktualisierter Bildschirm dargestellt, der den Stand der Dinge (die Erreichbarkeit der Zieladresse und aller Systeme dazwischen schön darstellt.
Will man das ganze per Mail verschicken:
mtr -r -i 0.2 -s 1400 -c 100 zieladresse
(-r
für Report, -i
für das Intervall in dem gepingt wird, -s
für die Größe der versendeten ICMP-Pakete, -c
für Anzahl der Durchläufe, die Zieladresse kann eine IP-Adresse oder ein auflösbarer DNS-Name sein)
Interessant auf Rechnern mit mehr als einem Interface (Multihomed). Wohin routen wir eigentlich? Vor allem wenn man Policy-Routing macht, ist das manchmal nicht ganz trivial mit Blick auf die Routing-Tabelle lösbar.
Frage: Auf welchen Wegen würden wir die IP-Adresse Ziel 10.20.30.40 routen, wenn die Quelladresse 192.168.5.6 verwendet wird?
# ip route get 10.20.30.40 from 192.168.5.6 10.20.30.40 from 192.168.5.6 via 172.16.10.1 dev eth0 cache mtu 1500 advmss 1460 hoplimit 64
Syntax:
ip route get ADDRESS [ from ADDRESS iif STRING ] [ oif STRING ] [ tos TOS ]
oif = outgoing interface, iif = incoming interface
siehe auch: ip manpage
echo -n "02:ff:48:";echo $RANDOM | openssl md5 | sed 's/(stdin)= //' | sed 's/\(..\)/\1:/g' | cut -b1-8 02:ff:48:21:cb:bf
Die Zuordnung von MAC-Adresse (z.B. 00:0c:29:2d:89:60
) zu Netzwerk-Device-Namen (eth0
/ eth1
..) passiert bei modernen Distributionen häufig via udev. Man kann diese Bennenung auch manuell anpassen …. hier Fundorte auf eigenen Systemen:
/etc/udev/rules.d/z25_persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules # program, probably run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single line. # MAC addresses must be written in lowercase. # PCI device 0x1022:0x2000 (pcnet32) SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:0c:29:c0:50:89", NAME="eth0" # PCI device 0x1022:0x2000 (pcnet32) SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:0c:29:2d:89:60", NAME="eth1"
/etc/udev/rules.d/30-net_persistent_names.rules
# This rules are autogenerated from /lib/udev/rename_netiface. # But you can modify them, but make sure that you don't use an interface name # twice. Also add such interface name rules only in this rules file. Otherwise # rename_netiface will create wrong rules for new interfaces. # It is safe to delete a rule, as long as you did not disable automatic rule # generation. Only if all interfaces get a rule the renaming will work # flawlessly. See also /etc/udev/rules.d/31-net_create_names.rules. # # Read /usr/share/doc/packages/sysconfig/README.Persistent_Interface_Names for # further information. # # Use only a-z, A-Z and 0-9 for interface names! # SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:1b:77:14:e5:f2", IMPORT="/lib/udev/rename_netiface %k eth0" SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:16:d3:93:be:a3", IMPORT="/lib/udev/rename_netiface %k eth1" SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:50:5b:31:24:c4", IMPORT="/lib/udev/rename_netiface %k eth2"
/etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules # program run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single line. # PCI device 0x14e4:0x167a (tg3) SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:19:b9:2c:5a:3c", NAME="eth0"
/etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:21:5d:61:ca:ed", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0" SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1d:72:86:34:b1", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Bei Red Hat ES gibt es eine riesige Datei /etc/sysconfig/hwconf
, die neben vielen anderen Hardware-Details auch MAC-Adresse und Interfacename beschreibt (ob man das dort auch einstellt, habe ich auf diesem Produktivsystem noch nicht ausprobiert)
... class: NETWORK bus: PCI detached: 0 device: eth1 driver: tg3 desc: "Broadcom Corporation NetXtreme BCM5704 Gigabit Ethernet" network.hwaddr: 00:17:A4:7F:12:64 vendorId: 14e4 deviceId: 1648 subVendorId: 0e11 subDeviceId: 00d0 pciType: 1 pcidom: 0 pcibus: 3 pcidev: 6 pcifn: 1 ...
Unter Ubuntu Feisty Fawn gibt es für die Zuordnung von MAC-Adresse zu Name eine eigene einfachere Config-Datei: /etc/iftab
# This file assigns persistent names to network interfaces. # See iftab(5) for syntax. eth0 mac 00:0c:29:2e:39:64 arp 1
/etc/udev/rules.d/70-persistent-net.rules
# net device (vif) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:16:3e:00:ab:09", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" # net device (vif) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:16:3e:00:cd:09", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
/etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib64/udev/write_net_rules # program run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single line. # PCI device 0x8086:0x105e (e1000) SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:1f:29:5b:dd:e3", NAME="eth0" # PCI device 0x8086:0x105e (e1000) SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:1f:29:5b:dd:e4", NAME="eth1" # PCI device 0x14e4:0x164c (bnx2) SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:21:5a:dc:de:b1", NAME="eth3" # PCI device 0x14e4:0x164c (bnx2) SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:21:5a:dc:de:b2", NAME="eth2"
gilt für alle Tipps, Tricks & Spickzettel:
dies sind einfache, teils banale Notizen für meinen persönlichen Gebrauch,
die hier eher zufällig auch öffentlich lesbar sind
(vielleicht hilft es ja jemandem weiter). Verwendung auf eigene Gefahr
Fehler-Hinweise, Dankesschreiben , etc. bitte an: web.21@unixwitch.de
weitere Tools / Spickzettel