华为园区网实验
概要
下面整一套普通公司中小型企业,常见的配置
设计知识点:
1、生成树,mstp
2、vrrp
3、trunk, channel 配置,vlan,端口VLAN划分等等
二、网络拓扑
lsw4 LSW3 配置,vlan,trunk ,生成树稍后配置
1 vlan b vlan 10 20 2 3 int eth 0/0/1 4 port link-t acc 5 port def vlan 10 6 7 int eth 0/0/2 8 port link-t acc 9 port def vlan 20 10 11 int gi 0/0/1 12 port link-t tr 13 port tr all vlan all 14 int gi 0/0/2 15 port link-t tr 16 port tr all vlan all
lsw1 lsw2 配置,trunk ,eth-trunk ,vlan
1 vlan b 10 20 2 3 int gi 0/0/1 4 port link-t tr 5 port tr all vlan all 6 int gi 0/0/2 7 port link-t tr 8 port tr all vlan all 9 10 int eth-trunk 1 11 port link-t tr 12 port tr all vlan all 13 14 int gi /0/0/23 15 eth-trunk 1 16 int gi 0/0/24 17 eth-tr 1
生成树,mstp 配置
sw3,sw4 配置相同
1 stp mo mstp 2 3 stp re 4 re mst1 5 ins 1 vlan 10 6 ins 2 vlan 20 7 ac re
sw1 配置
1 stp mo mstp 2 3 stp re 4 re mst1 5 ins 1 vlan 10 6 ins 2 vlan 20 7 ac re 8 9 stp ins 1 root pri 10 stp ins 2 root sec
sw2配置
stp mo mstp stp re re mst1 ins 1 vlan 10 ins 2 vlan 20 ac re stp ins 1 root sec stp ins 2 root pri
VRRP 的配置,与生成树配合,因为VLAN10 生成树的跟在sw1, vlan 20 生成树的跟在sw2 。
所以设置 vlan10 的 vrrp master 在sw1 ,vlan20 vrrp master 在sw2
sw1 配置
1 interface Vlanif10 2 ip address 192.168.10.252 255.255.255.0 3 vrrp vrid 10 virtual-ip 192.168.10.254 4 vrrp vrid 10 priority 120 5 vrrp vrid 10 preempt-mode timer delay 1 6 vrrp vrid 10 track interface GigabitEthernet0/0/22 reduced 20 7 vrrp vrid 10 authentication-mode simple huawei
interface Vlanif20
ip address 192.168.20.252 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
vrrp vrid 20 priority 105
vrrp vrid 20 preempt-mode timer delay 1
vrrp vrid 20 authentication-mode simple huawei
sw2 配置
1 interface Vlanif10 2 ip address 192.168.10.253 255.255.255.0 3 vrrp vrid 10 virtual-ip 192.168.10.254 4 vrrp vrid 10 priority 105 5 vrrp vrid 10 preempt-mode timer delay 1 6 vrrp vrid 10 authentication-mode simple huawei 7 8 interface Vlanif20 9 ip address 192.168.20.253 255.255.255.0 10 vrrp vrid 20 virtual-ip 192.168.20.254 11 vrrp vrid 20 priority 120 12 vrrp vrid 20 preempt-mode timer delay 1 13 vrrp vrid 20 track interface GigabitEthernet0/0/22 reduced 20 14 vrrp vrid 20 authentication-mode simple huawei 15 #
查看 vrrp 状态 dis vrrp
sw1
sw2
AR1 配置 ,模拟wan的配置
1 int loopb 0 2 ip add 1.1.1.1 32 3 4 int gi 0/0/0 5 ip add 11.1.1.1 30 6 7 int gi 0/0/0 8 ip add 12.1.1.1 30 9 10 ip route-s 192.168.10.0 24 11.1.1.2 11 ip route-s 192.168.10.0 24 12.1.1.2 pr 70 #浮动路由 12 13 ip route-s 192.168.20.0 24 12.1.1.2 14 ip route-s 192.168.20.0 24 11.1.1.2 pr 70
sw1 上配置 vlan 100 模拟器好像不能直接在物理端口上启动三层,可能选择的型号比较低。借助svi,然后将gi 0/0/22 划分到vlan100 中
1 vlan 100 2 3 int vlan 100 4 ip add 11.1.1.2 30 5 6 int gi 0/0/22 7 prot link-t acc 8 port def vlan 100 9 10 ip route-s 0.0.0.0 0 11.1.1.1
sw2
1 vlan 200 2 3 int vlan 200 4 ip add 12.1.1.2 30 5 6 int gi 0/0/22 7 prot link-t acc 8 port def vlan 200 9 10 ip route-s 0.0.0.0 0 12.1.1.1
当 sw1,或者 sw2 的的gi 0/0/22 端口down 的时候, VRRP 会却换状态,AR1 上的路由也会却换。
PC 访问 1.1.1.1 的路径也会变动,
实验结果,请自己尝试 测试,加深理解与记忆。
当sw2 端口down 之后
pc2
ar1 浮动路由出现。路径更改