双向转发检测BFD是一种用于检测邻居路由之间链路故障的检测机制,他通常与路由协议联动,通过快速感知链路故障并通告使得路由协议能够快速的重新收敛,从而减少由于拓扑变化导致的流量丢失。
查看邻居建立关系
[R1]dis rip 1 neighbor
---------------------------------------------------------------------
IP Address Interface Type Last-Heard-Time
---------------------------------------------------------------------
192.168.1.1 GigabitEthernet0/0/1 RIP 015
Number of RIP routes : 2
192.168.2.1 GigabitEthernet0/0/2 RIP 013
Number of RIP routes : 1
查看路由表,发现去往172.16.1.0/24下一跳是 192.168.1.1 接口是g0/0/1
[R1]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 13
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.16.1.0/24 RIP 100 1 D 192.168.1.1 GigabitEthernet0/0/1
192.168.1.0/24 Direct 0 0 D 192.168.1.2 GigabitEthernet0/0/1
192.168.1.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
192.168.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
192.168.2.0/24 Direct 0 0 D 192.168.2.2 GigabitEthernet0/0/2
192.168.2.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
192.168.2.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
192.168.3.0/24 RIP 100 1 D 192.168.2.1 GigabitEthernet0/0/2
RIP 100 1 D 192.168.1.1 GigabitEthernet0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
R1启用BFD
[R1]bfd
[R1-bfd]quit
[R1]rip 1
[R1-rip-1]bfd all
[R1-rip-1]bfd all-interfaces enable
[R1-rip-1]bfd all-interfaces min-rx-interval 100 min-tx-interval 100 detect-multiplier 10
[R1-rip-1]quit
R2启用BFD
[R2]bfd
[R2-bfd]quit
[R2]rip 1
[R2-rip-1]bfd all
[R2-rip-1]bfd all-interfaces enable
[R2-rip-1]bfd all-interfaces min-rx-interval 100 min-tx-interval 100 detect-multiplier 10
[R2-rip-1]quit
查看BFD,发现R1与R2已经建立成功
[R1]dis rip 1 bfd session all
LocalIp :192.168.1.2 RemoteIp :192.168.1.1 BFDState :Up
TX :100 RX :100 Multiplier:10
BFD Local Dis :8192 Interface :GigabitEthernet0/0/1
Diagnostic Info:No diagnostic information
LocalIp :192.168.2.2 RemoteIp :192.168.2.1 BFDState :Down
TX :13999 RX :13999 Multiplier:0
BFD Local Dis :8193 Interface :GigabitEthernet0/0/2
Diagnostic Info:No diagnostic information
手动关闭R2上面连接R1的接口,再次查看bfd发现不存在了
[R1]dis rip 1 bfd session all
LocalIp :192.168.2.2 RemoteIp :192.168.2.1 BFDState :Down
TX :13999 RX :13999 Multiplier:0
BFD Local Dis :8193 Interface :GigabitEthernet0/0/2
Diagnostic Info:No diagnostic information
再次查看路由表,发现去往172.16.1.0/24的下一跳更改了
[R1]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.16.1.0/24 RIP 100 2 D 192.168.2.1 GigabitEthernet0/0/2
192.168.2.0/24 Direct 0 0 D 192.168.2.2 GigabitEthernet0/0/2
192.168.2.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
192.168.2.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/2
192.168.3.0/24 RIP 100 1 D 192.168.2.1 GigabitEthernet0/0/2
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
全部0条评论
快来发表一下你的评论吧 !