網絡端口基礎信息與配置
這個主要是記錄一下關於交換機、防火牆和路由器的物理接口的一些基礎知識與配置。
命名規范
H3C的端口命名主要是根據端口的速率來進行區分的。基本都是千兆速率往上的,百兆的端口比較多用於二層傻瓜交換機或者不能CLI管理的。
根據端口速率分類:
端口速率 | 命名 |
---|---|
百兆 | F |
1G | GE |
10G | XGE |
40G | FGE |
端口號命名:
當設備工作在獨立運行模式時,以太網接口采用3維編號方式:interface type A/B/C。
- A:單板在設備上的槽位號。
- B:單板上的子卡號。如果單板上沒有子卡,取值固定為0。
- C:端口編號。
示例:GE 1/0/1 表示千兆板第一個槽位第一個子卡的第一個端口,其它的如XGE 1/0/1,FGE1/0/1等等。
端口速率配置
端口速率一般有10/100/1000/10000/40000
使用命令:speed 10/100/1000/auto
進行配置,默認為auto自動,不過極端情況下可能需要手動配置。
端口雙工模式配置
端口的雙工模式:全雙工/半雙工
使用命令:duplex full/half/auto
配置,默認auto。
端口模式
端口可以進行二層/三層配置。
- 二層模式(bridge),可以配置access/trunk/hybrid二層接口模式
- 三層模式(route),可以直接配置三層ip接口地址。
使用命令:port link-mode route/bridge
進行切換。
常用配置命令
進入接口使用。
- interface 命令
如:interface GE1/0/1 - port link-mode route/bridge
進行二/三層接口的轉換。 - port link-type access/trunk/hybrid
二層接口下才能使用,配置二層的接口模式。 - ip address 192.168.1.1 24
配置接口地址,三層接口使用。 - shutdown/undo shutdown
關閉/啟用端口。 - description text
配置接口描述信息,text是文本信息。 - speed 10/100/1000/auto
配置端口速率。 - duplex full/half/auto
配置端口雙工模式。 - default
恢復端口默認配置(清空配置)。
批量配置端口
使用range關鍵字進行批量端口配置。
# 使用range to批量配置端口。
interface range GigabitEthernet 1/0/1 to GigabitEthernet 1/0/23
示例:
查詢端口信息:
display interface brief
[H3C]display interface brief
Brief information on interfaces in route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Primary IP Description
InLoop0 UP UP(s) --
MGE0/0/0 DOWN DOWN --
NULL0 UP UP(s) --
REG0 UP -- --
Brief information on interfaces in bridge mode:
Link: ADM - administratively down; Stby - standby
Speed: (a) - auto
Duplex: (a)/A - auto; H - half; F - full
Type: A - access; T - trunk; H - hybrid
Interface Link Speed Duplex Type PVID Description
FGE1/0/53 DOWN 40G A A 1
FGE1/0/54 DOWN 40G A A 1
GE1/0/1 DOWN auto A A 1
GE1/0/2 DOWN auto A A 1
GE1/0/3 DOWN auto A A 1
GE1/0/4 DOWN auto A A 1
GE1/0/5 DOWN auto A A 1
GE1/0/6 DOWN auto A A 1
GE1/0/7 DOWN auto A A 1
GE1/0/8 DOWN auto A A 1
GE1/0/9 DOWN auto A A 1
GE1/0/10 DOWN auto A A 1
GE1/0/11 DOWN auto A A 1
GE1/0/12 DOWN auto A A 1
GE1/0/13 DOWN auto A A 1
GE1/0/14 DOWN auto A A 1
GE1/0/15 DOWN auto A A 1
GE1/0/16 DOWN auto A A 1
GE1/0/17 DOWN auto A A 1
GE1/0/18 DOWN auto A A 1
GE1/0/19 DOWN auto A A 1
GE1/0/20 DOWN auto A A 1
GE1/0/21 DOWN auto A A 1
GE1/0/22 DOWN auto A A 1
GE1/0/23 DOWN auto A A 1
GE1/0/24 DOWN auto A A 1
GE1/0/25 DOWN auto A A 1
GE1/0/26 DOWN auto A A 1
GE1/0/27 DOWN auto A A 1
GE1/0/28 DOWN auto A A 1
GE1/0/29 DOWN auto A A 1
GE1/0/30 DOWN auto A A 1
GE1/0/31 DOWN auto A A 1
GE1/0/32 DOWN auto A A 1
GE1/0/33 DOWN auto A A 1
GE1/0/34 DOWN auto A A 1
GE1/0/35 DOWN auto A A 1
GE1/0/36 DOWN auto A A 1
GE1/0/37 DOWN auto A A 1
GE1/0/38 DOWN auto A A 1
GE1/0/39 DOWN auto A A 1
GE1/0/40 DOWN auto A A 1
GE1/0/41 DOWN auto A A 1
GE1/0/42 DOWN auto A A 1
GE1/0/43 DOWN auto A A 1
GE1/0/44 DOWN auto A A 1
GE1/0/45 DOWN auto A A 1
GE1/0/46 DOWN auto A A 1
GE1/0/47 DOWN auto A A 1
GE1/0/48 DOWN auto A A 1
XGE1/0/49 DOWN 10G F A 1
XGE1/0/50 DOWN 10G F A 1
XGE1/0/51 DOWN 10G F A 1
XGE1/0/52 DOWN 10G F A 1