計算機に NIC (Network Interface Card) を2個 取り付けた場合 起動時に 特定する事ができない事が有ります。最初は うまく動作して いたのだが 、ある日突然 ? 断線 相手が 停止?? と慌てる 場合が有ります。
root にて
sv:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:90:CC:08:95:7C
inet addr:192.168.0.9 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:83 errors:0 dropped:0 overruns:0 frame:0
TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8728 (8.5 Kb) TX bytes:8081 (7.8 Kb)
Interrupt:10 Base address:0x7400
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:60 errors:0 dropped:0 overruns:0 frame:0
TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4200 (4.1 Kb) TX bytes:4200 (4.1 Kb)
してみると 現在の 状況を 見る事ができます。root にて ifconfig -a
sv:~# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:90:CC:08:95:7C
inet addr:192.168.0.9 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:117 errors:0 dropped:0 overruns:0 frame:0
TX packets:95 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11548 (11.2 Kb) TX bytes:12237 (11.9 Kb)
Interrupt:10 Base address:0x7400
eth1 Link encap:Ethernet HWaddr 00:00:E2:13:92:57
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:11 Base address:0x9000 Memory:5400000-5400038
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:60 errors:0 dropped:0 overruns:0 frame:0
TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4200 (4.1 Kb) TX bytes:4200 (4.1 Kb)
認識されている NIC カード も 表示されます。”arp”というものが有りま す ちょっと 見てみましょう
lx:~# arp Address HWtype HWaddress Flags Mask Iface adsl.bcnet.ne.jp ether 00:00:4C:BC:15:B8 C eth0 $ ping -c3 192.168.0.8 PING 192.168.0.8 (192.168.0.8): 56 octets data 64 octets from 192.168.0.8: icmp_seq=0 ttl=64 time=0.5 ms 64 octets from 192.168.0.8: icmp_seq=1 ttl=64 time=0.2 ms 64 octets from 192.168.0.8: icmp_seq=2 ttl=64 time=0.2 ms --- 192.168.0.8 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 0.2/0.3/0.5 ms # arp Address HWtype HWaddress Flags Mask Iface nl.bcnet.ne.jp ether 00:00:E2:1A:A4:E7 C eth0 adsl.bcnet.ne.jp ether 00:00:4C:BC:15:B8 C eth0
まあ 興味が有れば 調査すれば 良いでしょう。 御覧のように 通信していないと 表示は されません。ほかに ping を試みると
# arp Address HWtype HWaddress Flags Mask Iface nl.bcnet.ne.jp ether 00:00:E2:1A:A4:E7 C eth0 adsl.bcnet.ne.jp ether 00:00:4C:BC:15:B8 C eth0 ws.bcnet.ne.jp ether 00:00:4C:8E:0D:0B C eth0 mc.bcnet.ne.jp (incomplete) eth0
どんどん良くなる ... 太鼓です。ということで、”syslog”に こういうもの が記録されます。
lx:/var/log# cat syslog Oct 26 09:28:26 lx kernel: e100: eth0 NIC Link is Up 100 Mbps Full duplex
これは ”eth0”が ”e100”ですよ と 教えているようですが?
”lspci”というものが 有るようです、見てみると
lx:/var/log# lspci 00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 03) 00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03) 00:0d.0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 08) 00:0e.0 SCSI storage controller: LSI Logic / Symbios Logic 53c875 (rev 04) 00:0f.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) 00:14.0 ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02) 00:14.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01) 00:14.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01) 00:14.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02) 01:00.0 VGA compatible controller: ATI Technologies Inc 3D Rage Pro AGP 1X/2X (rev 5c)
オプションを付けると
lx:/var/log# lspci -v
00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev )
Flags: bus master, medium devsel, latency 64
Memory at 44000000 (32-bit, prefetchable) [size=64M]
Capabilities: [a0] AGP version 1.0
00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03(prog-if 00 [Normal decode])
Flags: bus master, 66Mhz, medium devsel, latency 64
Bus: primary=00, secondary=01, subordinate=01, sec-latency=32
I/O behind bridge: 00001000-00001fff
Memory behind bridge: 40000000-410fffff
00:0d.0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 08)
Subsystem: Intel Corp. EtherExpress PRO/100+ Management Adapter with Art On LAN*
Flags: bus master, medium devsel, latency 66, IRQ 11
Memory at 41200000 (32-bit, non-prefetchable) [size=4K]
I/O ports at 2800 [size=64]
Memory at 41100000 (32-bit, non-prefetchable) [size=1M]
Expansion ROM at <unassigned> [disabled] [size=1M]
Capabilities: [dc] Power Management version 2
00:0e.0 SCSI storage controller: LSI Logic / Symbios Logic 53c875 (rev 04)
Flags: bus master, medium devsel, latency 66, IRQ 11
I/O ports at 2000 [size=256]
Memory at 41400000 (32-bit, non-prefetchable) [size=256]
Memory at 41300000 (32-bit, non-prefetchable) [size=4K]
Expansion ROM at <unassigned> [disabled] [size=64K]
00:0f.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/81C+ (rev 10)
Subsystem: Elecom Co Ltd: Unknown device 1300
Flags: bus master, medium devsel, latency 66, IRQ 11
I/O ports at 2400 [size=256]
Memory at 41500000 (32-bit, non-prefetchable) [size=256]
Capabilities: [50] Power Management version 2
00:14.0 ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02)
Flags: bus master, medium devsel, latency 0
00:14.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01) (prog-if 8[Master])
Flags: bus master, medium devsel, latency 64
I/O ports at 2860 [size=16]
00:14.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01) (prog-if [UHCI])
Flags: bus master, medium devsel, latency 64, IRQ 11
I/O ports at 2840 [size=32]
00:14.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02)
Flags: medium devsel, IRQ 9
01:00.0 VGA compatible controller: ATI Technologies Inc 3D Rage Pro AGP 1X/2X ev 5c) (prog-if 00 [VGA])
Subsystem: ATI Technologies Inc Rage Pro Turbo AGP 2X
Flags: bus master, stepping, medium devsel, latency 66, IRQ 11
Memory at 40000000 (32-bit, non-prefetchable) [size=16M]
I/O ports at 1000 [size=256]
Memory at 41000000 (32-bit, non-prefetchable) [size=4K]
Expansion ROM at <unassigned> [disabled] [size=128K]
Capabilities: [50] AGP version 1.0
追加オプションは
lx:/var/log# lspci -vv
00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 03)
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ >SERR- <PERR-
Latency: 64
Region 0: Memory at 44000000 (32-bit, prefetchable) [size=64M]
Capabilities: [a0] AGP version 1.0
Status: RQ=31 SBA+ 64bit- FW- Rate=x1,x2
Command: RQ=0 SBA- AGP- 64bit- FW- Rate=<none>
00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03) (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
Status: Cap- 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 64
Bus: primary=00, secondary=01, subordinate=01, sec-latency=32
I/O behind bridge: 00001000-00001fff
Memory behind bridge: 40000000-410fffff
BridgeCtl: Parity- SERR- NoISA+ VGA+ MAbort- >Reset- FastB2B+
00:0d.0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 08)
Subsystem: Intel Corp. EtherExpress PRO/100+ Management Adapter with Alert On LAN*
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 66 (2000ns min, 14000ns max), cache line size 08
Interrupt: pin A routed to IRQ 11
Region 0: Memory at 41200000 (32-bit, non-prefetchable) [size=4K]
Region 1: I/O ports at 2800 [size=64]
Region 2: Memory at 41100000 (32-bit, non-prefetchable) [size=1M]
Expansion ROM at <unassigned> [disabled] [size=1M]
Capabilities: [dc] Power Management version 2
Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=2 PME-
00:0e.0 SCSI storage controller: LSI Logic / Symbios Logic 53c875 (rev 04)
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr+ Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 66 (4250ns min, 16000ns max), cache line size 08
Interrupt: pin A routed to IRQ 11
Region 0: I/O ports at 2000 [size=256]
Region 1: Memory at 41400000 (32-bit, non-prefetchable) [size=256]
Region 2: Memory at 41300000 (32-bit, non-prefetchable) [size=4K]
Expansion ROM at <unassigned> [disabled] [size=64K]
00:0f.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
Subsystem: Elecom Co Ltd: Unknown device 1300
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 66 (8000ns min, 16000ns max)
Interrupt: pin A routed to IRQ 11
Region 0: I/O ports at 2400 [size=256]
Region 1: Memory at 41500000 (32-bit, non-prefetchable) [size=256]
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1+,D2+,D3hot+,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
00:14.0 ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02)
Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 0
00:14.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01) (prog-if 80 [Master])
Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 64
Region 4: I/O ports at 2860 [size=16]
00:14.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01) (prog-if 00 [UHCI])
Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 64
Interrupt: pin D routed to IRQ 11
Region 4: I/O ports at 2840 [size=32]
00:14.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02)
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin ? routed to IRQ 9
01:00.0 VGA compatible controller: ATI Technologies Inc 3D Rage Pro AGP 1X/2X (rev 5c) (prog-if 00 [VGA])
Subsystem: ATI Technologies Inc Rage Pro Turbo AGP 2X
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping+ SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 66 (2000ns min), cache line size 08
Interrupt: pin A routed to IRQ 11
Region 0: Memory at 40000000 (32-bit, non-prefetchable) [size=16M]
Region 1: I/O ports at 1000 [size=256]
Region 2: Memory at 41000000 (32-bit, non-prefetchable) [size=4K]
Expansion ROM at <unassigned> [disabled] [size=128K]
Capabilities: [50] AGP version 1.0
Status: RQ=255 SBA+ 64bit- FW- Rate=x1,x2
Command: RQ=0 SBA- AGP- 64bit- FW- Rate=<none>
このくらいで 雰囲気は掴めたでしょう
”lsmod”と いうものがあるようです。
# lsmod Module Size Used by Not tainted autofs4 8052 0 (unused) nfsd 66448 1 (autoclean) lockd 45008 1 (autoclean) [nfsd] sunrpc 64608 1 (autoclean) [nfsd lockd] e100 46388 0 (unused) 8139too 13832 1 mii 2208 0 [8139too] crc32 2880 0 [8139too] keybdev 1796 0 (unused) mousedev 3860 0 (unused) input 3328 0 [keybdev mousedev] usb-uhci 21456 0 (unused) usbcore 58060 1 [usb-uhci]
この場合 ”e100 ”は ”(unused)”ということに なります。したがってケー ブルが こちら側に 接続されていない場合は ”ping -c3 127.0.0.1”とか 自分 自身に ”ping”すると 良いのですが 外部には 通らない という現象が 発生し ます。
明白に ”eth0” は どれどれ ”eth1” は これよ ということを していな いので しかたが 無いのですが、うまく動いていて ある日突然 ということなの で ケーブルの 断線 いや 相手側の 故障 を 疑う はめに なります。
解決 する方法として ”modules.conf”に ”alias”の 設定と いう事を 考 えます。 これが 最善では有りませんが 様子を 見ておきます。暫定としては これで 運用することに しています。
http://www.science.uva.nl/research/air/wiki/LogicalInterfaceNames
なんかを 見てみると 他にも いろいろな 手だてが 有るようです。
”HWaddr 00:90:CC:08:95:7C ”
というものが あります。メーカの 名前を 入手する方法に ついて 見ておき ましょう。ここに ゆきます
http://standards.ieee.org/regauth/oui/index.shtml
IEEE OUI and Company_id Assignments
Search the public OUI listing . . .
Search for 00-90-FE /* 入力例 ”00:90:FE”は 駄目 */
Search! clear field
の 所で(OUI : Organizationally Unique Identifier)下記参考
http://standards.ieee.org/regauth/oui/tutorials/EUI48.html
にて ”00-90-FE”を 入力すると (コロンでは うまく ゆかないようです。 つまり”00:90:FE”は 駄目な ようです。)
Here are the results of your search through the public section of the IEEE Standards OUI database report for 00-90-fe: 00-90-FE (hex) ELECOM CO., LTD. (LANEED DIV.) 0090FE (base 16) ELECOM CO., LTD. (LANEED DIV.) SUMITOMO FUDOSAN HIGASHI IKEBUKURO BLDG. 6F, 3-13-2 HIGAS TOSHIMA-KU TOKYO 170-0013 JAPAN Your attention is called to the fact that the firms and numbers \ listed may not always be obvious in product implementation. \ Some manufacturers subcontract component manufacture and others \ include registered firms' OUIs in their products.
”00-D0-B7 ”を 入力すると
Here are the results of your search through the public section of the IEEE Standards OUI database report for 00-D0-B7: 00-D0-B7 (hex) INTEL CORPORATION 00D0B7 (base 16) INTEL CORPORATION 5200 NE ELAM YOUNG PARKWAY HF1-08 HILLSBORO OR 97124 UNITED STATES Your attention is called to the fact that the firms and numbers \ listed may not always be obvious in product implementation. \ Some manufacturers subcontract component manufacture and others \ include registered firms' OUIs in their products.
最終的には
lx:/etc# echo "alias eth0 e100" >> modules.conf lx:/etc# echo "alias eth1 8139too" >> modules.conf lx:/etc# diff -s modules.conf 0001_backup/0007_20050119_modules.conf_org 85,86d84 < alias eth0 e100 < alias eth1 8139too
にて 運用 しています。つまり alias の 記述を 追加しています。
”NIC” 、”ifrename”、 ”iftab”等で 検索をされれば 上記の
http://www.science.uva.nl/research/air/wiki/LogicalInterfaceNames
なんかを 例として、いろいろもっと 情報が有りますが 、現状の対応は alias にて 対応と いうことで 運用します。 不都合が発生すれば また 検討を する事に なります。
残念ながら 不都合が 発生してしまいました。 次の対策として eth0 として 取り扱う方を kernel に 組み込む事に します。つまり ケーブル と カードを 特定したいと いう事です。でないと 再起動して eth0 と eth1 が入れ替われば ケーブルを 活線にて 切替える 必要が有るし 原因の 特定が できないかもしれ ません。
にゃんたろう 拝!
2007年11月19日 (月) 22:47:09 JST 作成