戻る

70-persistent-net.rules に 付いての 補足

なぜ eth が eth0 、eth1、eth2 に 変化するのか という事で 少し調べると。

”/etc/udev/rules.d/70-persistent-net.rules”ファイルが 関係している様です。 まあ 3台の計算機を 起動させると その結果は 以下の様になっていました。

# 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, and change only the value of the NAME= key.
    /*   適当に改行しています   */
# PCI device 0x14e4:/sys/devices/pci0000:00/0000:00:1c.5/0000:3f:00.0 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", \
ATTR{address}=="00:25:b3:d1:fe:cc", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
/*   ifconfig -a から 得られる部分 HWaddr 00:25:b3:d1:fe:cc  */
# PCI device 0x14e4:/sys/devices/pci0000:00/0000:00:1c.5/0000:3f:00.0 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", \
ATTR{address}=="18:a9:05:c1:e1:1d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x10de:/sys/devices/pci0000:00/0000:00:0f.0 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", \
ATTR{address}=="00:22:68:66:8b:12", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
/*   ifconfig -a から 得られる部分 HWaddr 00:22:68:66:8b:12 */

なにか ”ATTR{address}=”というのが 異なると 新しく追加するようです。

これは log を 残したものの 抜粋 ですが 以下の様な log が 残る

/var/log

# pwd
/var/log
# ls | grep 70-persistent-net.rules
20140314210214_70-persistent-net.rules
20140314210725_70-persistent-net.rules
20140314211424_70-persistent-net.rules

# cat 20140314210214_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, and change only the value of the NAME= key.

# PCI device 0x14e4:/sys/devices/pci0000:00/0000:00:1c.5/0000:3f:00.0 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:b3:d1:fe:cc", \
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# cat 20140314210725_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, and change only the value of the NAME= key.

# PCI device 0x10de:/sys/devices/pci0000:00/0000:00:0f.0 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:68:66:8b:12", \
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# cat 20140314211424_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, and change only the value of the NAME= key.

# PCI device 0x14e4:/sys/devices/pci0000:00/0000:00:1c.5/0000:3f:00.0 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="18:a9:05:c1:e1:1d", \
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

個々の計算機の ifconfig -a の 抜粋

# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:25:b3:d1:fe:cc  
          inet addr:192.168.0.5  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::225:b3ff:fed1:fecc/64 Scope:Link
          ...

# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:22:68:66:8b:12  
          inet addr:192.168.0.62  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::222:68ff:fe66:8b12/64 Scope:Link
          ...
# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 18:a9:05:c1:e1:1d  
          inet addr:192.168.0.62  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::1aa9:5ff:fec1:e11d/64 Scope:Link
          ...

まあ log を 気を付けて 置かないといけないが 良 としませう。

# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdc2             12483376   9042904   2811276  89% /mnt
...

にゃんたろう 拝!

2014年 3月 15日 土曜日 22:11:12 JST 作成


戻る

Copyright © 2006.-2014. nyantarou All Rights Reserved.