LSW1//配置如下:
<Huawei>sys
[Huawei]vlan batch 10 20 50
[Huawei]interface eth//进入链路聚合
[Huawei]interface Eth-Trunk 1//创建链路聚合端口 并命名为1
[Huawei-Eth-Trunk1]port link-type access//配置聚合Trunk1为access类型
[Huawei-Eth-Trunk1]port default vlan 50//配置聚合Trunk1归属为VLAN 50
[
Huawei-GigabitEthernet0/0/1]port link-type access//配置端口类型
[
Huawei-GigabitEthernet0/0/1]port default vlan 10//配置端口归属VLAN
[
Huawei-GigabitEthernet0/0/10]port link-type access//配置端口类型
[
Huawei-GigabitEthernet0/0/10]port default vlan 20//配置端口归属VLAN
[
Huawei-GigabitEthernet0/0/23]port link-type access//配置端口类型
[
Huawei-GigabitEthernet0/0/23]port default vlan 50//配置端口归属VLAN
[
Huawei-GigabitEthernet0/0/24]port link-type access//配置端口类型
[
Huawei-GigabitEthernet0/0/24]port default vlan 50//配置端口归属VLAN
[Huawei-Vlanif50]ip address 192.168.50.1 24//配置VLAN IP
[Huawei-Vlanif10]ip address 192.168.1.1 24//配置VLAN IP
[Huawei-Vlanif20]ip address 192.168.2.1 24//配置VLAN IP
查看路由表 [Huawei]dis ip routing-table
------------------------------------------------------------------------------
[Huawei]ip route-static 192.168.3.0 24 192.168.50.2//配置静态路由路径
[Huawei]ip route-static 192.168.4.0 24 192.168.50.2//配置静态路由路径
查看路由表 [Huawei]dis ip routing-table
LSW2//配置如下:
[Huawei]vlan batch 30 40 50
[Huawei]interface eth//进入链路聚合
[Huawei]interface Eth-Trunk 1//创建链路聚合端口 并命名为1
[Huawei-Eth-Trunk1]port link-type access//配置聚合Trunk1为access类型
[Huawei-Eth-Trunk1]port default vlan 50//配置聚合Trunk1归属为VLAN 50
[Huawei]int Vlanif 30//进入VLAN30
[Huawei-Vlanif30]ip address 192.168.3.1 24//配置VLAN IP
[Huawei]int Vlanif 40//进入VLAN40
[Huawei-Vlanif40]ip address 192.168.4.1 24//配置VLAN IP
[Huawei]int Vlanif 50//进入VLAN50
[Huawei-Vlanif50]ip address 192.168.50.2 24//配置VLAN IP
[
Huawei-GigabitEthernet0/0/1]port link-type access//配置端口类型
[
Huawei-GigabitEthernet0/0/1]port default vlan 30//配置端口归属VLAN
[
Huawei-GigabitEthernet0/0/10]port link-type access//配置端口类型
[
Huawei-GigabitEthernet0/0/10]port default vlan 40//配置端口归属VLAN
[
Huawei-GigabitEthernet0/0/23]port link-type access//配置端口类型
[
Huawei-GigabitEthernet0/0/23]port default vlan 50//配置端口归属VLAN
[
Huawei-GigabitEthernet0/0/24]port link-type access//配置端口类型
[
Huawei-GigabitEthernet0/0/24]port default vlan 50//配置端口归属VLAN
[Huawei]ip route-static 192.168.1.0 24 192.168.50.1//配置静态路由路径
[Huawei]ip route-static 192.168.2.0 24 192.168.50.1//配置静态路由路径
查看路由表 [Huawei]dis ip routing-table