当前位置: 首页 > 工具软件 > trunk8 > 使用案例 >

eNSP下园区网综合实验分步配置(1)Eth-Trunk、Vlan、Trunk

壤驷安和
2023-12-01

链路聚合(Eth-Trunk):

接入交换机SW6与汇聚交换机SW3

SW6(接入):
<Huawei>system-view
[Huawei]sysname JieRu-SW6
[JieRu-SW6]undo info-center enable //关闭日志
[JieRu-SW6]interface Eth-Trunk 1
[JieRu-SW6-Eth-Trunk1]mode lacp-static 
[JieRu-SW6-Eth-Trunk1]trunkport GigabitEthernet 0/0/1
[JieRu-SW6-Eth-Trunk1]trunkport GigabitEthernet 0/0/2

SW3(汇聚):
<Huawei>system-view
[Huawei]sysname HuiJu-SW3
[HuiJu-SW3]undo info-center enable
[HuiJu-SW3]int Eth-Trunk 1
[HuiJu-SW3-Eth-Trunk1]mode lacp-static 
[HuiJu-SW3-Eth-Trunk1]trunkport GigabitEthernet 0/0/2
[HuiJu-SW3-Eth-Trunk1]trunkport GigabitEthernet 0/0/3

核心交换机SW1、SW2

SW1(核心):
<Huawei>sys
[Huawei]sysname HeXin-SW1
[HeXin-SW1]undo info-center enable
[HeXin-SW1]interface Eth-Trunk 2
[HeXin-SW1-Eth-Trunk2]mode lacp-static 
[HeXin-SW1-Eth-Trunk2]trunkport GigabitEthernet 0/0/2
[HeXin-SW1-Eth-Trunk2]trunkport GigabitEthernet 0/0/3

SW2(核心):
<Huawei>system-view
[Huawei]sysname HeXin-SW2
[HeXin-SW2]undo info-center enable
[HeXin-SW2]interface Eth-Trunk 2
[HeXin-SW2-Eth-Trunk2]mode lacp-static 
[HeXin-SW2-Eth-Trunk2]trunkport GigabitEthernet 0/0/1
[HeXin-SW2-Eth-Trunk2]trunkport GigabitEthernet 0/0/2

可以用如下命令查看聚合端口:

[HeXin-SW1]display eth-trunk 2
//正常情况下可以看到两个端口被选择

Vlan及Trunk配置:

SW5(接入):
<Huawei>system-view	
[Huawei]sysname JieRu-SW5
[JieRu-SW5]undo info-center enable
[JieRu-SW5]vlan batch 2 to 5 1000
//尽管没有vlan 4 5的流量,但为了后边配置mst,所以全部配置
//vlan 1000做管理vlan使用,后边Telnet用到
[JieRu-SW5]interface Ethernet0/0/2
[JieRu-SW5-Ethernet0/0/2]port link-type access 
[JieRu-SW5-Ethernet0/0/2]port default vlan 2
[JieRu-SW5-Ethernet0/0/2]quit
[JieRu-SW5]interface GigabitEthernet 0/0/1
[JieRu-SW5-GigabitEthernet0/0/1]port link-type trunk 
[JieRu-SW5-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 1000
[JieRu-SW5-GigabitEthernet0/0/1]quit

SW6(接入):
[JieRu-SW6]vlan batch 2 to 5 1000
[JieRu-SW6]int Ethernet 0/0/3
[JieRu-SW6-Ethernet0/0/3]port link-type ac
[JieRu-SW6-Ethernet0/0/3]po de vlan 3
[JieRu-SW6-Ethernet0/0/3]qu
[JieRu-SW6]int Eth-Trunk 1
[JieRu-SW6-Eth-Trunk1]port link-type trunk 
[JieRu-SW6-Eth-Trunk1]port trunk allow-pass vlan 3 1000
[JieRu-SW6-Eth-Trunk1]qu

SW3(汇聚):
[HuiJu-SW3]vlan batch 2 to 5 1000
[HuiJu-SW3]int GigabitEthernet 0/0/1
[HuiJu-SW3-GigabitEthernet0/0/1]port link-type tr
[HuiJu-SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[HuiJu-SW3-GigabitEthernet0/0/1]qu
[HuiJu-SW3]int Eth-Trunk 1
[HuiJu-SW3-Eth-Trunk1]port link-type tr
[HuiJu-SW3-Eth-Trunk1]qu
[HuiJu-SW3]int Eth-Trunk 1
[HuiJu-SW3-Eth-Trunk1]port trunk allow-pass vlan all
[HuiJu-SW3-Eth-Trunk1]qu
[HuiJu-SW3]port-group group-member GigabitEthernet 0/0/4 GigabitEthernet 0/0/5
[HuiJu-SW3-port-group]port link-type trunk 
[HuiJu-SW3-GigabitEthernet0/0/4]port link-type trunk 
[HuiJu-SW3-GigabitEthernet0/0/5]port link-type trunk 
[HuiJu-SW3-port-group]port trunk allow-pass vlan all
[HuiJu-SW3-GigabitEthernet0/0/4]port trunk allow-pass vlan all
[HuiJu-SW3-GigabitEthernet0/0/5]port trunk allow-pass vlan all
[HuiJu-SW3-port-group]qu

----------------
SW7(接入):
<Huawei>sys
[Huawei]sysname JieRu-SW7
[JieRu-SW7]un in en
[JieRu-SW7]vlan batch 2 to 5 1000
[JieRu-SW7]int GigabitEthernet 0/0/2
[JieRu-SW7-GigabitEthernet0/0/2]port link-type ac
[JieRu-SW7-GigabitEthernet0/0/2]port de vlan 4
[JieRu-SW7-GigabitEthernet0/0/2]qu
[JieRu-SW7]int gi 0/0/3
[JieRu-SW7-GigabitEthernet0/0/3]port link-type ac
[JieRu-SW7-GigabitEthernet0/0/3]po de vlan 5
[JieRu-SW7-GigabitEthernet0/0/3]qu
[JieRu-SW7]int GigabitEthernet 0/0/1
[JieRu-SW7-GigabitEthernet0/0/1]port trunk allow-pass vlan 4 5 1000
[JieRu-SW7-GigabitEthernet0/0/1]qu


SW4(汇聚):
<Huawei>sys
[Huawei]sysname HuiJu-SW4
[HuiJu-SW4]un in en
[HuiJu-SW4]vlan batch 2 to 5 1000
[HuiJu-SW4]port-group group-member GigabitEthernet 0/0/1 GigabitEthernet 0/0/2 G
igabitEthernet 0/0/3
[HuiJu-SW4-port-group]port link-type trunk
[HuiJu-SW4-GigabitEthernet0/0/1]port link-type trunk
[HuiJu-SW4-GigabitEthernet0/0/2]port link-type trunk
[HuiJu-SW4-GigabitEthernet0/0/3]port link-type trunk
[HuiJu-SW4-port-group]port tr	
[HuiJu-SW4-port-group]port trunk al	
[HuiJu-SW4-port-group]port trunk allow-pass vlan all
[HuiJu-SW4-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[HuiJu-SW4-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[HuiJu-SW4-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[HuiJu-SW4-port-group]qu

----------------
SW8(供服务器使用):
<Huawei>sys
[Huawei]sysname SW8
[SW8]un in en
[SW8]vlan batch 2 to 5 200 1000
[SW8]PORT-G group-member Ethernet 0/0/3 Ethernet 0/0/4
[SW8-Ethernet0/0/4]port link-type ac
[SW8-port-group]po de vlan 200
[SW8-Ethernet0/0/3]po de vlan 200
[SW8-Ethernet0/0/4]po de vlan 200
[SW8-port-group]qu
[SW8]port-g group-member Ethernet 0/0/1 Ethernet 0/0/2
[SW8-port-group]port link-type trunk 
[SW8-Ethernet0/0/1]port link-type trunk 
[SW8-Ethernet0/0/2]port link-type trunk 
[SW8-port-group]port trunk allow-pass vlan 200 1000
[SW8-Ethernet0/0/1]port trunk allow-pass vlan 200 1000
[SW8-Ethernet0/0/2]port trunk allow-pass vlan 200 1000
[SW8-port-group]qu

----------------

SW1(核心):
<HeXin-SW1>sys
[HeXin-SW1]vlan batch 2 to 5 200 1000
[HeXin-SW1]int GigabitEthernet 0/0/5
[HeXin-SW1-GigabitEthernet0/0/5]port link-type tr
[HeXin-SW1-GigabitEthernet0/0/5]port tr allow-pass vlan 200 1000
[HeXin-SW1-GigabitEthernet0/0/5]qu
[HeXin-SW1]int GigabitEthernet 0/0/1
[HeXin-SW1-GigabitEthernet0/0/1]port link-type tr
[HeXin-SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3 1000
[HeXin-SW1-GigabitEthernet0/0/1]qu
[HeXin-SW1]int GigabitEthernet 0/0/4
[HeXin-SW1-GigabitEthernet0/0/4]port link-ty tr
[HeXin-SW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 4 5 1000
[HeXin-SW1-GigabitEthernet0/0/4]qu
[HeXin-SW1]int Eth-Trunk 2
[HeXin-SW1-Eth-Trunk2]port link-type tr
[HeXin-SW1-Eth-Trunk2]port trunk allow-pass vlan all
[HeXin-SW1-Eth-Trunk2]qu
[HeXin-SW1]vlan 800 //用于创建三层SVI接口
[HeXin-SW1-vlan800]qu
[HeXin-SW1]int GigabitEthernet 0/0/6
[HeXin-SW1-GigabitEthernet0/0/6]port link-type ac
[HeXin-SW1-GigabitEthernet0/0/6]port default vlan 800

SW2(核心):
[HeXin-SW2]vlan batch 2 to 5 200 801 1000
[HeXin-SW2]int GigabitEthernet 0/0/3
[HeXin-SW2-GigabitEthernet0/0/3]port link-ty tr
[HeXin-SW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 4 5 1000
[HeXin-SW2-GigabitEthernet0/0/3]qu
[HeXin-SW2]int GigabitEthernet 0/0/4
[HeXin-SW2-GigabitEthernet0/0/4]port link-type tr
[HeXin-SW2-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3 1000
[HeXin-SW2-GigabitEthernet0/0/4]qu
[HeXin-SW2]int Eth-Trunk 2
[HeXin-SW2-Eth-Trunk2]port link-type trunk 
[HeXin-SW2-Eth-Trunk2]port tr allow-pass vlan all
[HeXin-SW2-Eth-Trunk2]qu
[HeXin-SW2]int GigabitEthernet 0/0/5
[HeXin-SW2-GigabitEthernet0/0/5]port link-type tr
[HeXin-SW2-GigabitEthernet0/0/5]port tr all vlan 200 1000
[HeXin-SW2-GigabitEthernet0/0/5]qu
[HeXin-SW2]int gi0/0/6
[HeXin-SW2-GigabitEthernet0/0/6]port link-type ac
[HeXin-SW2-GigabitEthernet0/0/6]port de vlan 801

当需要将某个交换机端口由trunk改为access,可以:

undo port default vlan xx
或
undo port  trunk allow-pass vlan all

而后
undo port link-type

裁剪vlan的目的在于减小广播域范围。

 类似资料: