拓扑:
0x01 R1 R2配置静态路由并设置优先级
#R1
interface GigabitEthernet0/0/0
ip address 12.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 21.1.1.1 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 21.1.1.2
ip route-static 0.0.0.0 0.0.0.0 12.1.1.2 preference 50
#R2
interface GigabitEthernet0/0/0
ip address 12.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 21.1.1.2 255.255.255.0
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 21.1.1.1
ip route-static 0.0.0.0 0.0.0.0 12.1.1.1 preference 50
#
0x02 配置bfd
(1)配置静态bfd
#bfd全局使能
[r2]bfd
[r2-bfd]quit
#
R1配置bfd,bfd名称为aa 对端地址12.1.1.2 本端地址12.1.1.1
bfd aa bind peer-ip 12.1.1.2 source-ip 12.1.1.1
discriminator local 1
discriminator remote 2
commit
#R2配置bfd,bfd名称为aa 对端地址12.1.1.1 本端IP为12.1.1.2
bfd aa bind peer-ip 12.1.1.1 source-ip 12.1.1.2
discriminator local 2
discriminator remote 1
commit
(2)配置动态bfd(好处,不需要填写discriminator local与discriminator remote值)
#R1配置
bfd aa bind peer-ip 12.1.1.2 source-ip 12.1.1.1 auto
commit
#R2配置
bfd aa bind peer-ip 12.1.1.1 source-ip 12.1.1.2 auto
commit
0x03 静态路由调用bfd即可
[r1]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2 preference 50 track bfd-session aa
[r2]ip route-static 0.0.0.0 0.0.0.0 12.1.1.1 preference 50 track bfd-session aa
0x04 其他
bfd检测用的是udp的3784端口,默认发送间隔时间是1000ms
#查看BFD状态
[r2]dis bfd session all
#查看详细内容
[r2]dis bfd session all verbose
发表评论