
我使用舊電腦作為家庭伺服器/防火牆,使用基於 Linux 的發行版(Mandriva)。最初,它有兩個網卡,一個eth0
是主機板適配器,另一個eth1
是10/100 PCI網卡。
eth0
連接到其他裝置所連接的內部交換機,並eth1
連接至網際網路機上盒路由器。
隨著時間的推移和新用途的出現,我添加了兩個千兆位元 PCI 網路卡 (DLink DGE-528T),從而成為eth2
和eth3
,用於與它們所替換的卡相同的功能。即eth2
連接內部交換器和eth3
連接路由器。
一切都工作正常,直到幾週前,當我注意到我失去了連接eth3
並查看卡本身時,電纜插入插頭時不再「發出咔嗒聲」。事實證明,電纜存在一些濫用,導致 RJ45 連接器彎曲並使其不可靠。
因此,我決定更換eth3
新的千兆卡(TP-LINK TG-3269),它似乎沒有如此脆弱的連接器。該卡因此被稱為eth4
並eth3
已從伺服器中完全刪除。
但是,我似乎無法讓那張新卡與路由器一起使用,插入後背面的 LED 燈永遠不會亮起。果然,ifplugd
兩者ethtool
都表明沒有建立連結。作為臨時解決方法,我重新使用eth1
,以便伺服器仍然繼續發揮其作用,儘管處於降級模式。
我以為這張卡是“吐司”,但我嘗試了一些事情並得到了一些奇怪的結果,總結如下:
- 連接
eth4
到內部交換器:LED 亮起,以 1000Mb 建立連接 - 連接
eth4
到eth0
:LED 亮起,以 100Mb 建立連接 - 連接
eth2
到路由器:LED 亮起,以 1000Mb 建立連接
所以看來路由器不想與我的eth4
卡片對話,原因我無法解釋。
環顧與我的問題有些相似的各種線程,我發現了該mii-diag
工具並首先在沒有電纜的情況下運行它,然後插入路由器電纜。結果如下:
[obones@server ~]$ sudo mii-diag eth4
Basic registers of MII PHY #32: 1000 7949 001c c913 0de1 0000 0004 2001.
Basic mode control register 0x1000: Auto-negotiation enabled.
Basic mode status register 0x7949 ... 7949.
Link status: not established.
End of basic transceiver information.
[obones@server ~]$ sudo mii-diag eth4
Basic registers of MII PHY #32: 1000 7949 001c c913 0de1 c5e1 000f 2001.
The autonegotiated capability is 01e0.
The autonegotiated media type is 100baseTx-FD.
Basic mode control register 0x1000: Auto-negotiation enabled.
Basic mode status register 0x7949 ... 7949.
Link status: not established.
Your link partner advertised c5e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT, w/ 802.3X flow control.
End of basic transceiver information.
我知道這mii-diag
不是千兆位元感知,但我發現有趣的是,在第二種情況下,它檢測到有一個連結夥伴,但連結尚未建立。
這可能是什麼原因?接下來我該嘗試什麼?
根據需要,這裡有一些額外的細節。
eth3
該路由器絕對具有千兆位元能力,並且在連接器發生故障之前以該速度運行良好。連接到 時eth2
,它也能以千兆位元速度運作。
dmesg -T | grep eth4
不輸出任何內容
這是 lspci 的輸出:
00:0a.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet [10ec:8169] (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet [10ec:8169]
00:0b.0 Ethernet controller [0200]: D-Link System Inc DGE-528T Gigabit Ethernet Adapter [1186:4300] (rev 10)
Subsystem: D-Link System Inc DGE-528T Gigabit Ethernet Adapter [1186:4300]
00:0d.0 Ethernet controller [0200]: Intel Corporation 82557/8/9/0/1 Ethernet Pro 100 [8086:1229] (rev 08)
00:13.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ [10ec:8139] (rev 10)
還有來自 lshw 的:
*-network:0
description: Ethernet interface
product: RTL-8169 Gigabit Ethernet
vendor: Realtek Semiconductor Co., Ltd.
physical id: a
bus info: pci@0000:00:0a.0
logical name: eth4
version: 10
serial: 14:cc:20:05:38:22
size: 10MB/s
capacity: 1GB/s
width: 32 bits
clock: 66MHz
capabilities: pm bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half latency=64 link=no maxlatency=64 mingnt=32 multicast=yes port=MII speed=10MB/s
resources: irq:18 ioport:a000(size=256) memory:f7109000-f71090ff memory:c0180000-c019ffff(prefetchable)
*-network:1
description: Ethernet interface
product: DGE-528T Gigabit Ethernet Adapter
vendor: D-Link System Inc
physical id: b
bus info: pci@0000:00:0b.0
logical name: eth2
version: 10
serial: 1c:7e:e5:26:54:a0
size: 1GB/s
capacity: 1GB/s
width: 32 bits
clock: 66MHz
capabilities: pm bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full ip=10.10.10.254 latency=64 link=yes maxlatency=64 mingnt=32 multicast=yes port=MII speed=1GB/s
resources: irq:19 ioport:a400(size=256) memory:f710b000-f710b0ff memory:c01a0000-c01bffff(prefetchable)
*-network:2
description: Ethernet interface
product: 82557/8/9/0/1 Ethernet Pro 100
vendor: Intel Corporation
physical id: d
bus info: pci@0000:00:0d.0
logical name: eth1
version: 08
serial: 00:90:27:ca:ba:e8
size: 100MB/s
capacity: 100MB/s
width: 32 bits
clock: 33MHz
capabilities: pm bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e100 driverversion=3.5.24-k2-NAPI duplex=full firmware=N/A ip=192.168.1.253 latency=64 link=yes maxlatency=56 mingnt=8 multicast=yes port=MII speed=100MB/s
resources: irq:17 memory:f710a000-f710afff ioport:ac00(size=64) memory:f7000000-f70fffff memory:c0000000-c00fffff(prefetchable)
*-network:3
description: Ethernet interface
product: RTL-8139/8139C/8139C+
vendor: Realtek Semiconductor Co., Ltd.
physical id: 13
bus info: pci@0000:00:13.0
logical name: eth0
version: 10
serial: 00:14:85:c0:ea:2b
size: 10MB/s
capacity: 100MB/s
width: 32 bits
clock: 33MHz
capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=8139too driverversion=0.9.28 duplex=half ip=10.10.10.250 latency=64 link=no maxlatency=64 mingnt=32 multicast=yes port=MII speed=10MB/s
resources: irq:18 ioport:e000(size=256) memory:f710d000-f710d0ff
您認為eth4
在沒有自動協商的情況下強制卡片處於千兆位元可以解決這個問題嗎?如果我是正確的,命令將是這樣的:
ethtool -s eth4 duplex full speed 1000 autoneg off
我今晚會嘗試,但為什麼一開始就不起作用?
答案1
好吧,我現在知道為什麼eth4
無法建立連結了,在對電纜進行了更多的擺弄之後我想到了這一點。應該知道的是,即使是在家裡,我也會使用配線架來調度各種連結。這意味著伺服器正在透過這種安排連接到路由器:
server <--> cable <--> plug <--> wall <--> plug <--> patch bay <--> plug <--> router
在我最初的訊息中,我說eth2
將以 1G 連接到路由器,這在當時是正確的。
但本週我再次嘗試,這種情況不再發生,這立即讓我意識到我遇到的最初問題eth3
是在濫用電纜之後發生的。果然,使用牆上的另一個插頭連接到接線盒,可以以eth4
1G 正確連接到路由器。
所以,最終,它與硬體有關,只是不是我期望的那種硬體。
非常感謝所有對我的問題發表評論的人,我和你們一起學到了很多技巧,很抱歉在我應該更徹底地檢查電纜時浪費了你們的時間。