HCIP-进阶实验07-高可靠性园区网部署

发布时间 2023-07-12 14:40:54作者: Qurare

HCIP-进阶实验07-高可靠性园区网部署

1 实验需求

1.1 实验拓扑

image-20230711152356926

1.2 实验环境说明

设备 接口 IP地址 备注
AR1 G0/0/0 172.16.1.1/24
G0/0/1 172.16.2.1/24
loopback0 202.22.2.2/24 ISP
SW1
VLANIF10 192.168.1.254/24
VLANIF20 192.168.2.253/24
SW2
VLANIF10 192.168.1.253/24
VLANIF20 192.168.2.254/24

1.3 实验需求

本实验采用2台PC,3台交换机,1台路由器。 ISP用环回口模拟;认真分析实验需求,明确每步考查的知识点,并规划 IP 地址;根据拓扑搭建实验环境,确保端口都双UP后再进行下面步骤:

  1. 根据拓扑配置好相关接口的地址,交换机SW1与SW2之间使用Eth-trunk,要求在SW2上使其成为主动端, 并且有2条活跃链路,1条备份链路
  2. 交换机之间起trunk,在交换机SW1、SW2、SW3创建VLAN 10、 20、 30、 40;并且把PC1划入VLAN10,PC2划入VLAN20
  3. 要求交换机之间使用MSTP生成树协议,并且SW1为vlan10、30的根桥,vlan 20、40的备份根桥,SW2为vlan20、40的根桥,vlan 10、30的备份根桥
  4. 为了保证PC1、PC2上网的连续性,需要在该网络应用网关冗余技术,VLAN 10的虚拟IP地址为192.168.1.100,VLAN 20的虚拟IP地址为192.168.2.200,保证SW1成为vlan 10的Master且开启延迟抢占15秒;SW2成为vlan 20的Master且开启延迟抢占20秒
  5. 为了保证设备的流量能够到达路由器,故要求把交换机连接路由器的接口设置为Access,并划分对应VLAN(连接SW1,VLAN 30;SW2 VLAN31),连接网段分别为:172.16.1.0/24(SW1和AR1)和172.16.2.0/24(SW2和AR1),并在交换机上指一条关于出接口的默认路由使其能与路由器正常通信
  6. 为了防止上行链路故障时,网关不能及时切换,请配置SW1的上行链路跟踪,保证网关能够实现切换
  7. 为了防止上行链路故障时,网关不能快速切换,请配置SW2与AR1上使用BFD技术,保证网关能够实现快速切换

2 实验步骤

2.1 地址配置+vlan划分+网络互联

vlan划分+链路聚合

AR1

sy
sys AR1
int g0/0/0
	ip add 172.16.200.1 24
	qu
int g0/0/1
	ip add 172.16.100.1 24
	qu
int loopback 0
	ip add 202.22.2.2 24
	qu
ospf 1 
	area 0
		network 172.16.100.0 0.0.0.255
		network 172.16.200.0 0.0.0.255
		qu
	qu

LSW1

sy
sys LSW1
vlan batch 10 20 30 40 100
int vlan 10 
	ip add 192.168.1.254 24
    qu
int vlan 20
	ip add 192.168.2.253 24
	qu
int vlan 100
	ip add 172.16.100.2 24
	qu
int eth-trunk 1
	mode lacp-static	
	max active-linknumber 2		
	least active-linknumber 1	
	trunkport g0/0/3
	trunkport g0/0/4
	trunkport g0/0/5
	port link-type trunk
	port trunk allow-pass 10 20 30 40
	qu
int g0/0/1
	port link-type trunk
	port trunk allow-pass vlan 10 20 30 40
	qu
int g0/0/2
	port link-type access
	port default vlan 100
	qu
ospf 1 
	area 0
		network 172.16.100.0 0.0.0.255
		network 172.16.200.0 0.0.0.255
		network 192.168.1.0 0.0.0.255
		network 192.168.2.0 0.0.0.255
		qu
	qu
ip route-static 0.0.0.0 0 172.16.1.1

LSW2

sy
sys LSW2
vlan batch 10 20 30 40 200
int vlan 10 
	ip add 192.168.1.253 24
    qu
int vlan 20
	ip add 192.168.2.254 24
	qu
int vlan 200
	ip add 172.16.200.2 24
	qu
int eth-trunk 1
	mode lacp-static	
	max active-linknumber 2		
	least active-linknumber 1	
	trunkport g0/0/3
	trunkport g0/0/4
	trunkport g0/0/5
	port link-type trunk
	port trunk allow-pass vlan 10 20 30 40
	qu
int g0/0/1
	port link-type trunk
	port trunk allow-pass vlan 10 20 30 40
	qu
int g0/0/2
	port link-type access
	port default vlan 200
	qu
ospf 1 
	area 0
		network 172.16.100.0 0.0.0.255
		network 172.16.200.0 0.0.0.255
		network 192.168.1.0 0.0.0.255
		network 192.168.2.0 0.0.0.255
		qu
	qu
ip route-static 0.0.0.0 0 172.16.2.1

LSW3

sy
sys LSW3
vlan batch 10 20 30 40
int g0/0/1
	port link-type access
	port default vlan 10
	qu
int g0/0/2
	port link-type access
	port default vlan 20
	qu
int g0/0/3
	port link-type trunk
	port trunk allow-pass vlan 10 20 30 40
	qu
int g0/0/4
	port link-type trunk
	port trunk allow-pass vlan 10 20 30 40
	qu

image-20230712115004247

image-20230712115015875

两台PC暂且无法ping通AR的环回口, 因为我直接配的VRRP的VID做网关

2.2 MSTP配置

LSW1

stp mode mstp
stp region-configuration
	region-name test
	revision-level 10
	instance 1 vlan 10 20
	instance 2 vlan 30 40
	active region-configuration
qu
stp instance 1 root primary
stp instance 2 root secondary

LSW2

stp mode mstp
stp region-configuration
	region-name test
	revision-level 10
	instance 1 vlan 10 20
	instance 2 vlan 30 40
	active region-configuration
qu
stp instance 2 root primary
stp instance 1 root secondary

LSW3

stp mode mstp
stp region-configuration
	region-name test
	revision-level 10
	instance 1 vlan 10 20
	instance 2 vlan 30 40
	active region-configuration
qu

2.3 VRRP

LSW1

int vlanif 10
	vrrp vrid 1 virtual-ip 192.168.1.100
	vrrp vrid 1 priority 200
	vrrp vrid 1 preempt-mode timer delay 15
	qu
int vlanif 20
	vrrp vrid 2 virtual-ip 192.168.2.200
	vrrp vrid 2 preempt-mode timer delay 20
	qu

LSW2

int vlanif 10
	vrrp vrid 1 virtual-ip 192.168.1.100
	vrrp vrid 1 preempt-mode timer delay 15
	qu
int vlanif 20
	vrrp vrid 2 virtual-ip 192.168.2.200
	vrrp vrid 2 priority 200
	vrrp vrid 2 preempt-mode timer delay 20
	qu

此时PC1和PC2均可ping通AR1的环回口202.22.2.2

image-20230712115056306

2.4 BFD和VRRP track

LSW1(track)

int vlan10 
	vrrp vrid 1 track int g0/0/2 reduced 120
	qu

LSW2(BFD)

bfd
	qu
bfd trackbfd bind peer-ip 172.16.200.1 interface Vlanif 200
	discriminator local 200
	discriminator remote 100
	commit
	qu
int vlan20
	vrrp vrid 2 track bfd-session 200 reduced 130
	qu

AR1

bfd
	qu
bfd 1 bind peer-ip 172.16.200.2 interface g0/0/0
	discriminator local 100
	discriminator remote 200
	commit
	qu

配置验证

  1. 当链路正常时vlanif10的master为LSW1, 其优先级为200, vlanif20的master为LSW2, 其优先级为200, backup设备优先级均为100

    image-20230712133014732

    image-20230712133331060

    image-20230712133348714

    image-20230712133300670

  2. 断开LSW1与AR的连接

    image-20230712133449439

    此时LSW1的vlanif10上vrrp优先级200-120=80, 同时变为backup设备, LSW2以100的优先级成为vlanif10的master, PC1的流量从LSW2转发到AR1

    image-20230712133613695

    image-20230712133719378

    image-20230712133823710

  3. 恢复LSW1与AR1的连接, 等待vlanif10的15s抢占时间, LSW1重新成为vlanif10的master, 然后断开AR1与LSW2的连接, 观察到LSW1成为了vlanif20的master

    image-20230712143120552

    image-20230712143136727

PC2的数据也切换为使用LSW1进行转发

image-20230712143225077

3 遇到问题

  1. bfd无法联动

    image-20230712140514672

    原因是配置成了静态的bfd

    image-20230712140648817

    回顾一下bfd的知识点, bfd与其他协议联动时需要使用动态bfd, 动态bfd的特点就是只需要配置本地标识符, 然后自动获取远端标识符, 所以此时bfd-session应该为本地标识符而非bfd的id或者是name

    错误配置

    vrrp vrid 2 track bfd-session session-name lsw2toar1 reduced 130
    

    正确配置

    vrrp vrid 2 track bfd-session 200 reduced 130