CodingBox 說明文件

各 NOS 端口配置方法:速率、FEC、拆分與強制覆蓋

模組被接受之後,還需要告訴端口該怎麼處理它:用甚麼速率、用甚麼 FEC、是否自動協商、是否拆分,以及——在嚴格的平台上——是否容忍第三方身份。命令因 NOS 而異,往往還因平台和版本而異。本頁把常見系統的代表性命令並列列出;把它們當作配置甚麼的地圖,具體語法請在平台的指南中確認。

兩端必須一致的設定

設定原因常見陷阱
速率SerDes 通道速率必須與模組速率一致25G 端口配 10G 模組,或雙速率模組停在錯誤的速率上(速率
FEC多數 25G+ PMD 上強制要求;兩端必須使用相同的編碼一端 RS-FEC,另一端無 FEC:光功率正常但無鏈路(FEC 與 AN
自動協商 / 鏈路訓練25G+ 的 DAC 上必須開啟,多數光模組上禁止光模組上留了 AN,或 DAC 上關閉了 AN
拆分父端口拆分為子端口只在一端配置,或用在 WDM 光模組上
介質 / 模式combo 端口,銅口 SFP 上 SGMII 與 1000BASE-X 的選擇生效的介質類型不對
第三方繞過嚴格平台上的策略開關模組本身沒問題,端口卻 errdisabled(廠商鎖定

按 NOS 分類的配置

尖括號表示佔位符; 表示因平台而異的部分。

Cisco IOS-XE(Catalyst)

interface TwentyFiveGigE1/0/1
 speed 10000                       ! 或 25000(平台允许按端口设置速率时)
 fec cl74                          ! cl74 = BASE-R,cl91/cl108 = RS-FEC,off
 no negotiation auto               ! 光模块;DAC 保持 auto
service unsupported-transceiver    ! 全局命令,多数版本中为隐藏命令
no errdisable detect cause gbic-invalid
errdisable recovery cause gbic-invalid
show interfaces transceiver detail

Cisco NX-OS(Nexus)

interface Ethernet1/1
 speed 25000
 fec rs-fec                        ! rs-fec | fc-fec | off | auto
 no negotiate auto
interface breakout module 1 port 1-4 map 25g-4x     ! 或:hw-module breakout …(较旧版本)
service unsupported-transceiver
show interface ethernet1/1 transceiver details

Cisco IOS-XR

controller Optics0/0/0/0
 breakout 4x25                     ! 或:hw-module port-range 0 3 location … mode 4x25
interface HundredGigE0/0/0/0
 fec standard | none
show controllers optics 0/0/0/0

Arista EOS

interface Ethernet1
   speed forced 25gfull            ! forced 10000full, 40gfull, 100gfull …
   error-correction encoding reed-solomon    ! fire-code | disabled
   no negotiation
interface Ethernet33/1-4           ! 拆分:在 /1-/4 子端口上配置速率
   speed forced 25gfull
hardware port-group 1 select Et33/1-4        ! 部分平台
transceiver qsfp default-mode 4x10G          ! QSFP+ 端口的默认模式
show interfaces transceiver dom

Juniper Junos (QFX/EX)

set chassis fpc 0 pic 0 port 0 channel-speed 25g       ! QFX 上的 breakout 4x25G
set chassis fpc 0 pic 0 port 48 speed 10g               ! 部分型号上按端口设置速率
set interfaces et-0/0/0 gigether-options fec fec91      ! fec74 | fec91 | none
set interfaces et-0/0/0 ether-options no-auto-negotiation
show interfaces diagnostics optics et-0/0/0
show chassis pic fpc-slot 0 pic-slot 0                  ! 列出"unsupported"光模块

Huawei VRP (CloudEngine)

interface 25GE1/0/1
 port mode 10GE                    ! 或:S 系列上用 speed 10000
 fec-mode rs-fec                   ! base-r | rs-fec | none(因平台而异)
 negotiation auto disable
port split dimension interface 100GE1/0/1 split-type 4*25GE     ! 拆分,部分设备需要 commit/重启
transceiver phony-alarm-disable    ! 系统视图:抑制非华为光模块告警
display transceiver interface 25GE1/0/1 verbose

H3C Comware

interface Twenty-FiveGigE1/0/1
 using tengige                     ! 切换端口模式
 port fec mode rs-fec              ! (语法因设备而异)
transceiver phony-alarm-disable
display transceiver interface Twenty-FiveGigE1/0/1

HPE Aruba AOS-CX / AOS-S

! AOS-CX
interface 1/1/49
    speed 25000-full
    error-control rs-fec           ! 或:fec …(因平台而异)
allow-unsupported-transceiver
show interface 1/1/49 transceiver detail
! AOS-S(ProCurve)
allow-unsupported-transceiver
show interfaces transceiver detail

Dell OS10

interface breakout 1/1/1 map 25g-4x
interface ethernet1/1/1:1
 speed 25000
 fec CL91                          ! CL74 | CL91 | CL108 | off
 no negotiation
show interface ethernet 1/1/1:1 transceiver

SONiC

config interface speed Ethernet0 25000
config interface fec Ethernet0 rs           ! rs | fc | none
config interface autoneg Ethernet0 disabled
config interface breakout Ethernet0 4x25G   ! 动态端口拆分(取决于平台支持)
show interfaces transceiver eeprom -d Ethernet0
show interfaces status

Nvidia Cumulus (NVUE)

nv set interface swp1 link speed 25G
nv set interface swp1 link fec rs
nv set interface swp1 link auto-negotiate off
nv set interface swp1 link breakout 4x25G
nv config apply
l1-show swp1

MikroTik RouterOS

/interface ethernet set sfp-sfpplus1 auto-negotiation=no speed=10G-baseSR-LR
/interface ethernet set sfp28-1 fec-mode=fec91          ! fec74 | fec91 | off | auto
/interface ethernet monitor sfp-sfpplus1

Linux 主機(伺服器網卡)

ethtool -s eth0 speed 25000 duplex full autoneg off
ethtool --set-fec eth0 encoding rs             # rs | baser | off | auto
ethtool -m eth0                                # 身份信息和 DDM
# Intel ixgbe/i40e:允许非 Intel SFP(模块参数;请查阅驱动文档)
modprobe ixgbe allow_unsupported_sfp=1

驗證結果

  1. 兩端鏈路都在預期速率下 up;沒有 LOL 或 FEC 不可糾正計數 (VDM 與 FEC 指標)。
  2. show … transceiver 把模組顯示為受支援(或被容忍),並帶有 DDM 數值 (在交換機上驗證光模組)。
  3. 流量運行幾分鐘後計數正常(鏈路抖動)。
  4. 配置已保存;在拆分或端口模式變更需要重載的平台上,重載後改動依然生效。

在 CodingBox 中

配置速查告訴端口該做甚麼;模組告訴端口它能做甚麼。配置速率或拆分之前,先在 Check transceiver 中讀取模組的速率代碼和 CMIS Applications——端口不能被配置成模組未聲明的模式。

Linux 主機方案背後完整的伺服器側工具集——ethtool、mlxlink、bnxtnvm、Windows 和 ESXi 命令、從網卡讀取 DDM:網卡工具與診斷

各配置方案背後的介面命名(Gi1/0/1、et-0/0/48:1、Ethernet0、swp1s0…):端口命名與指示燈;上聯配置中的 LAG/MLAG 部分:堆疊與 MLAG


如果您發現本文有不準確之處或錯誤,請選取相應片段並按 Ctrl+Enter,即可