工具准备:

eNSP

下载链接:

https://pan.baidu.com/s/1qhrTXrRSimsUi5UpfePg6g?pwd=0rxh

提取码:0rxh

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

需求1:PC1,PC2,PC3互通

交换机A

#Vlan1配IP地址

[Huawei]interface Vlanif 1

[Huawei-Vlanif1]ip address 192.168.1.1 24

[Huawei]quit

#创建Vlan100 101

[Huawei]vlan batch 100 101

#Vlan100 101 配置IP地址

[Huawei]interface Vlanif 100

[Huawei-Vlanif100]ip address 192.168.2.1 24

[Huawei-Vlanif100]quit

[Huawei]interface Vlanif 101

[Huawei-Vlanif101]ip address 192.168.3.1 24

[Huawei-Vlanif101]quit

#配置trunk口

[Huawei]interface GigabitEthernet 0/0/1

[Huawei-GigabitEthernet0/0/1]port link-type trunk

[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all

[Huawei-GigabitEthernet0/0/1]quit

#配置access口

[Huawei]interface GigabitEthernet 0/0/10

[Huawei-GigabitEthernet0/0/10]port link-type access

[Huawei-GigabitEthernet0/0/10]port default vlan 100

[Huawei-GigabitEthernet0/0/10]quit

[Huawei]interface GigabitEthernet 0/0/11

[Huawei-GigabitEthernet0/0/11]port link-type access

[Huawei-GigabitEthernet0/0/11]port default vlan 101

#静态路由

[Huawei]ip route-static 192.168.4.0 24 192.168.1.2

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

交换机B

#Vlan1配IP地址

[Huawei]interface Vlanif 1

[Huawei-Vlanif1]ip address 192.168.1.2 24

[Huawei]quit

#创建Vlan100

[Huawei]vlan batch 100

#Vlan100 配置IP地址

[Huawei]interface Vlanif 100

[Huawei-Vlanif100]ip address 192.168.4.1 24

[Huawei-Vlanif100]quit

#配置trunk口

[Huawei]interface GigabitEthernet 0/0/1

[Huawei-GigabitEthernet0/0/1]port link-type trunk

[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all

[Huawei-GigabitEthernet0/0/1]quit

#配置access口

[Huawei]interface GigabitEthernet 0/0/10

[Huawei-GigabitEthernet0/0/10]port link-type access

[Huawei-GigabitEthernet0/0/10]port default vlan 100

[Huawei-GigabitEthernet0/0/10]quit

#静态路由

[Huawei]ip route-static 192.168.2.0 24 192.168.1.1

[Huawei]ip route-static 192.168.3.0 24 192.168.1.1

需求2:端口聚合

交换机A和交换机B做相同的配置

#创建聚合口1

[Huawei]interface Eth-Trunk 1

#配置聚合口为trunk模式

[Huawei-Eth-Trunk1]port link-type trunk

#允许所有Vlan通过

[Huawei-Eth-Trunk1]port trunk allow-pass vlan all

#设置自动工作模式

[Huawei-Eth-Trunk1]mode lacp-static

#将端口1,2加入聚合口

[Huawei-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/2