构建实验拓扑图
实验思路:下面4个vlan分别网关都指向三层交换机LSW1,其余分别做聚合链路,这里R1路由器的IP写在聚合链路上,连接R1路由器的三层交换机IP写在vlan上,最后使用Rip通告,实现全网互通。
IP配置省略
LSW1配置
[Huawei]vl batch 10 20 30 40 50 //同时创建多个vlan
[Huawei]int vl 10 //进入vlan 10
[Huawei-Vlanif10]ip add 1.1.1.1 24 // 给vlan 10 写入对应的IP,作为网关
[Huawei-Vlanif10]int vl 20
[Huawei-Vlanif20]ip add 2.1.1.1 24
[Huawei-Vlanif20]int vl 30
[Huawei-Vlanif30]ip add 3.1.1.1 24
[Huawei-Vlanif30]int vl 40
[Huawei-Vlanif40]ip add 4.1.1.1 24
[Huawei-Vlanif40]int vl 50
[Huawei-Vlanif50]ip add 5.1.1.1 24
[Huawei-Vlanif40]q
[Huawei]int g0/0/1 //进入0/1接口
[Huawei-GigabitEthernet0/0/1]port link ac //绑定接口类型为access接入链路
[Huawei-GigabitEthernet0/0/1]port de vl 10 //接口划分vlan 10
[Huawei-GigabitEthernet0/0/1]q
[Huawei]int Eth-Trunk 1 //创建编号为1的聚合
[Huawei-Eth-Trunk1]trunkport g 0/0/4 to 0/0/6 //划分g 0/0/4 ~ 0/0/6 为聚合的链路
[Huawei-Eth-Trunk1]port link tr //将聚合进行trunk快速通过
[Huawei-Eth-Trunk1]port tr al vl al //并允许通过所有vlan
[Huawei-Eth-Trunk1]q
[Huawei]rip //宣告Rip路由协议
[Huawei-rip-1]version 2 //更改Rip版本为2
[Huawei-rip-1]un summ //关闭自动汇总
[Huawei-rip-1]net 1.0.0.0 //宣告路由器直连的网段
[Huawei-rip-1]net 2.0.0.0
[Huawei-rip-1]net 3.0.0.0
[Huawei-rip-1]net 4.0.0.0
[Huawei-rip-1]net 5.0.0.0
[Huawei-rip-1]q
[Huawei]int Eth-Trunk 2
[Huawei-Eth-Trunk2]trunkport g 0/0/2 to 0/0/3
[Huawei-Eth-Trunk2]port link-type access
[Huawei-Eth-Trunk2]port default vlan 50 //将接口划分vlan 50
LSW2配置
[Huawei]vl batch 10 20 30 40 50
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link ac
[Huawei-GigabitEthernet0/0/1]port de vl 20
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link ac
[Huawei-GigabitEthernet0/0/2]port de vl 30
[Huawei-GigabitEthernet0/0/2]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link ac
[Huawei-GigabitEthernet0/0/3]port de vl 40
[Huawei-GigabitEthernet0/0/3]q
[Huawei]int Eth-Trunk 1
[Huawei-Eth-Trunk1]trunkport g 0/0/4 to 0/0/6
[Huawei-Eth-Trunk1]port link tr
[Huawei-Eth-Trunk1]port tr al vl al
R1配置
[Huawei]int Eth-Trunk 2
[Huawei-Eth-Trunk2]undo portswitch //关闭二层转发功能
[Huawei-Eth-Trunk2]trunkport g 0/0/1 to 0/0/2
[Huawei-Eth-Trunk2]ip add 5.1.1.2 24
[Huawei]int Eth-Trunk 3
[Huawei-Eth-Trunk3]undo portsw
[Huawei-Eth-Trunk3]trunkport g 3/0/0
[Huawei-Eth-Trunk3]trunkport g 4/0/0
[Huawei-Eth-Trunk3]ip add 6.1.1.1 24
[Huawei-Eth-Trunk3]q
[Huawei]rip
[Huawei-rip-1]version 2
[Huawei-rip-1]un summary
[Huawei-rip-1]net 5.0.0.0
[Huawei-rip-1]net 6.0.0.0
R2配置
[Huawei]int Eth-Trunk 3
[Huawei-Eth-Trunk3]undo portsw
[Huawei-Eth-Trunk3]trunkport g 0/0/1 to 0/0/2
[Huawei-Eth-Trunk3]ip add 6.1.1.2 24
[Huawei-Eth-Trunk3]q
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 7.1.1.1 24
[Huawei-GigabitEthernet0/0/0]q
[Huawei]rip
[Huawei-rip-1]version 2
[Huawei-rip-1]un summ
[Huawei-rip-1]net 7.0.0.0
[Huawei-rip-1]net 6.0.0.0
[Huawei-rip-1]q