赞
踩
实验目的:
通过链接建立两条链路分别为主备链路,当主链路出现故障,备链路接替工作,当主链路恢复,自动切回主链路工作,联动 bfd 实现毫秒级切换
实验TOP图
实验配置
R1
-
-
- system-view
-
- sysname R1 路由器命名
-
- interface Vlanif1 E/0/0/1 口无法配置 IP 所以用Vlanif1 代替
- ip address 1.1.1.254 255.255.254.0
-
- interface Ethernet0/0/0 配置E/0/0/1为 A口 默认属于VLAN1 就不需要配置了
- port link-type access
-
- interface GigabitEthernet0/0/0 配置端口IP
- ip address 3.1.12.1 255.255.255.0
-
- interface GigabitEthernet0/0/1
- ip address 3.1.13.1 255.255.255.0
-
- bfd配置------------------------------------------------------------
-
- bfd
- delay-up 50 全局开启BFD 配置UP延时
- q 退出视图
- bfd ar1 bind peer-ip 3.1.24.3 建立BFD会话
- discriminator local 1 配置本地标识符
- discriminator remote 2 配置对端标识符
- min-tx-interval 50 发送bfd报文间隔50ms
- min-rx-interval 50 接收bfd报文间隔50ms
- commit 提交bfd配置
-
- 路由配置------------------------------------------------------------
- PC1-PC2 路由:
-
- ip route-static 2.1.1.0 255.255.255.0 3.1.12.2 track bfd-session ar1 联动BFD ar1
- ip route-static 2.1.1.0 255.255.255.0 3.1.13.2 preference 80 备份链路优先级设置高点
-
- bfd 链路路由:
- ip route-static 3.1.24.0 255.255.255.0 3.1.12.2
- ip route-static 3.1.24.0 255.255.255.0 3.1.13.2 preference 80 备份链路优先级设置高点
R2
- system-view
-
- sysname R2
-
- interface GigabitEthernet0/0/0 配置端口IP
- ip address 3.1.24.2 255.255.255.0
-
- interface GigabitEthernet0/0/1
- ip address 3.1.12.2 255.255.255.0
-
- 配置静态路由
- ip route-static 1.1.1.0 255.255.255.0 3.1.12.1
- ip route-static 2.1.1.0 255.255.255.0 3.1.24.3
R3
- system-view
-
- sysname R3
-
- interface GigabitEthernet0/0/0 配置端口IP
- ip address 3.1.13.2 255.255.255.0
-
- interface GigabitEthernet0/0/1
- ip address 3.1.34.2 255.255.255.0
-
-
- ip route-static 1.1.1.0 255.255.255.0 3.1.13.1 配置静态路由
- ip route-static 2.1.1.0 255.255.255.0 3.1.34.3
R4(注释参考R1)
- system-view
-
- sysname R4
-
- interface Vlanif1
- ip address 2.1.1.254 255.255.255.0
-
- interface Ethernet0/0/1
- port link-type access
-
- interface GigabitEthernet0/0/0
- ip address 3.1.34.3 255.255.255.0
-
- interface GigabitEthernet0/0/1
- ip address 3.1.24.3 255.255.255.0
-
- bfd配置------------------------------------------------------------
-
- bfd
- delay-up 50
- q
- bfd ar4 bind peer-ip 3.1.12.1
- discriminator local 2
- discriminator remote 1
- min-tx-interval 50
- min-rx-interval 50
- commit
-
- 路由配置------------------------------------------------------------
-
- ip route-static 1.1.1.0 255.255.255.0 3.1.24.2 track bfd-session ar4
- ip route-static 1.1.1.0 255.255.255.0 3.1.34.2 preference 80
- ip route-static 3.1.12.0 255.255.255.0 3.1.24.2
- ip route-static 3.1.12.0 255.255.255.0 3.1.34.2 preference 80
结果验证:正常状态下数据走主路,当主链路down,毫秒级切换到备份链路,主路up,毫秒级切换回去。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。