天天看點

華為交換機Trunk配置

華為交換機Trunk配置

Trunk

采用Trunk中繼鍊路技術可以實作不同交換機同網段的Vlan間通信。Trunk中繼技術可以實作在一條實體線路中可以傳遞多個Vlan間的資訊,如:交換機從屬于Vlan2的端口接收到資料,在Trunk中繼鍊路上進行傳輸前,會先打上一個标記,表明該資料包是Vlan2的,到達對方交換機時,交換機會将該标記去掉,隻發送到屬于Vlan2的端口上。

例:以下拓撲圖中,子網路遮罩都為255.255.255.0

Vlan1:

左:192.168.1.1 192.168.1.2

右:192.168.1.3 192.168.1.4

Vlan2:

左:192.168.:2.1 192.168.2.2

右:192.168.2.3 192.168.2.4

Vlan3:

左:192.168.3.1 192.168.3.2

右:192.168.3.3 192.168.3.4

華為交換機Trunk配置

S3700-LSW1

<Huawei>system-view
[Huawei]interface Eth0/0/7
[Huawei-Ethernet0/0/7]port link-type trunk
[Huawei-Ethernet0/0/7]port trunk allow-pass vlan all
[Huawei]display current-configuration
#
interface Ethernet0/0/1
 port link-type access
#
interface Ethernet0/0/2
 port link-type access
#
interface Ethernet0/0/3
 port link-type access
 port default vlan 2
#
interface Ethernet0/0/4
 port link-type access
 port default vlan 2
#
interface Ethernet0/0/5
 port link-type access
 port default vlan 3
#
interface Ethernet0/0/6
 port link-type access
 port default vlan 3
#
interface Ethernet0/0/7
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
           

S3700-LSW2

<Huawei>system-view
[Huawei]interface Eth0/0/3
[Huawei-Ethernet0/0/3]port link-type trunk
[Huawei-Ethernet0/0/3]port trunk allow-pass vlan all
[Huawei]display current-configuration
#
interface Ethernet0/0/1
 port link-type access
 port default vlan 2
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 2
#
interface Ethernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/4
 port link-type access
#
interface Ethernet0/0/5
 port link-type access
#
interface Ethernet0/0/6
 port link-type access
 port default vlan 3
#
interface Ethernet0/0/7
 port link-type access
 port default vlan 3
           

測試

華為交換機Trunk配置
華為交換機Trunk配置
華為交換機Trunk配置

不同交換機同網段Vlan之間能夠互相ping通,說明兩個交換機接口配置的Trunk中繼鍊路技術實作成功。

↓↓↓↓↓↓

 最近剛申請了個微信公衆号,上面也會分享一些運維知識,大家點點發财手關注一波,感謝大家。

【原創公衆号】:非著名運維 【福利】:公衆号回複 “資料” 送運維自學資料大禮包哦!

華為交換機Trunk配置

如果你覺得這篇文章還不錯,就請動動你的發财手為本文留個言,點個在看,或者轉發一下吧,因為這将是我持續輸出更多優質文章的最強動力!

繼續閱讀