1、靜態路由與BFD聯動(直連)ide
H3C靜態路由默認下AD=60oop
拓撲見QQ收藏
spa
正常狀況下,1.1.1.1訪問2.2.2.2 時數據經過S1->S2,當S1-S2的鏈路出現故障,快速切換到S1->S3->S2接口
S1配置:ip
[S1]vlan 10路由
[S1-vlan10]vlan 20it
[S1]int E1/0/1class
[S1-Ethernet1/0/1]port link-type access配置
[S1-Ethernet1/0/1]port access vlan 10route
[S1-Ethernet1/0/1]int e1/0/2
[S1-Ethernet1/0/2]port link-type access
[S1-Ethernet1/0/2]port access vlan 20
[S1-Ethernet1/0/2]int vlan 10
[S1-Vlan-interface10]ip add 12.1.1.1 24
[S1-Vlan-interface10]int vlan 20
[S1-Vlan-interface20]ip add 13.1.1.1 24
[S1]int LoopBack 1
[S1-LoopBack1]ip add 1.1.1.1 32
[S1]ip route-static 23.1.1.0 24 13.1.1.3 沒有這條路由,鏈路切換不過來
[S1] ip route-static 2.2.2.2 32 Vlan-interface10 12.1.1.2 bfd control-packet
[S1]ip route-static2.2.2.2 32 13.1.1.3 preference 100
[S1-Vlan-interface10]bfd min-transmit-interval 300
[S1-Vlan-interface10]bfd min-receive-interval 300
[S1-Vlan-interface10]bfd detect-multiplier 10 注意在接口配置,不是系統視圖
S2配置:
[S2]vlan 10
[S2-vlan10]vlan 30
[S2]int e1/0/1
[S2-Ethernet1/0/1]port link-type access
[S2-Ethernet1/0/1]port access vlan 10
[S2]int e1/0/2
[S2-Ethernet1/0/2]port link-type access
[S2-Ethernet1/0/2]port access vlan 30
[S2]int vlan 10
[S2-Vlan-interface10]ip add 12.1.1.2 24
[S2-Vlan-interface10]int vlan 30
[S2-Vlan-interface30]ip add 23.1.1.2 24
[S2]int LoopBack 0
[S2-LoopBack0]ip add 2.2.2.2 32
[S2]ip route-static 13.1.1.0 24 23.1.1.3
[S2] ip route-static1.1.1.1 32 Vlan-interface10 12.1.1.1 bfd control-packet
[S2]ip route-static1.1.1.1 32 23.1.1.3 preference 100
[S2-Vlan-interface10]bfd min-transmit-interval 300
[S2-Vlan-interface10]bfd min-receive-interval 300
[S2-Vlan-interface10]bfd detect-multiplier 10
S3配置:
[S3]vlan 20
[S3-vlan20]vlan 30
[S3-vlan30]int e1/0/1
[S3-Ethernet1/0/1]port link-type access
[S3-Ethernet1/0/1]port access vlan 20
[S3-Ethernet1/0/1]int e1/0/2
[S3-Ethernet1/0/2]port link-type access
[S3-Ethernet1/0/2]port access vlan 30
[S3]int vlan 20
[S3-Vlan-interface20]ip add 13.1.1.3 24
[S3-Vlan-interface20]int vlan 30
[S3-Vlan-interface30]ip add 23.1.1.3 24
[S3]ip route-static1.1.1.1 32 13.1.1.1
[S3]ip route-static 2.2.2.232 23.1.1.2
注意:因爲用的是交換機,爲了防止環路,因此有一個接口會是阻塞狀態,切換的速度快慢取決於STP的模式
2、靜態路由與BFD的聯動(非直連)
拓撲見QQ收藏
R1配置
[R1]int G0/0
[R1-GigabitEthernet0/0]ipadd 10.1.1.1 24
[R1-GigabitEthernet0/0]undoshut
[R1-GigabitEthernet0/0]intg0/1
[R1-GigabitEthernet0/1]ipadd 13.1.1.1 24
[R1-GigabitEthernet0/1]intlo 0
[R1-LoopBack0]ipadd 1.1.1.1 32
[R1-LoopBack0]int lo 11
[R1-LoopBack11]ipadd 11.1.1.1 32
[R1]bfd multi-hop min-transmit-interval 500
[R1] bfd multi-hop min-receive-interval 500
[R1] bfd multi-hop detect-multiplier 9
[R1] ip route-static 2.2.2.2 32 22.2.2.2 bfd control-packet bfd-source 11.1.1.1
[R1] ip route-static 2.2.2.232 13.1.1.3 preference 100
[R1]ip route-static 20.1.1.0 24 10.1.1.10
[R1]ip route-static 22.2.2.2 32 10.1.1.10
[R1]ip route-static 23.1.1.0 24 13.1.1.3
R2配置
[R2]int g0/0
[R2-GigabitEthernet0/0]ipadd 20.1.1.2 24
[R2-GigabitEthernet0/0]undoshut
[R2-GigabitEthernet0/0]intg0/1
[R2-GigabitEthernet0/1]ipadd 23.1.1.2 24
[R2-GigabitEthernet0/1]undoshut
[R2-GigabitEthernet0/1]intlo 0
[R2-LoopBack0]ipadd 2.2.2.2 32
[R2-LoopBack0]intlo 22
[R2-LoopBack22]ipadd 22.2.2.2 32
[R2]bfd multi-hop min-transmit-interval 500
[R2] bfd multi-hop min-receive-interval 500
[R2] bfd multi-hop detect-multiplier 9
[R2] ip route-static 1.1.1.1 32 11.1.1.1 bfd control-packet bfd-source 22.2.2.2
[R2] ip route-static 1.1.1.1 32 23.1.1.3 preference 100
[R2]ip route-static 11.1.1.1 32 20.1.1.20
[R2]ip route-static 10.1.1.0 24 20.1.1.20
[R2]ip route-static 13.1.1.0 24 23.1.1.3
R3配置
[R3]int g0/0
[R3-GigabitEthernet0/0]ip add 13.1.1.3 24
[R3-GigabitEthernet0/0]undo shut
[R3-GigabitEthernet0/0]int g0/1
[R3-GigabitEthernet0/1]ip add 23.1.1.3 24
[R3-GigabitEthernet0/1]undo shut
[R3]ip route-static 1.1.1.1 32 13.1.1.1
[R3]ip route-static 2.2.2.2 32 23.1.1.2
R0的配置
[R0]vlan 10
[R0-vlan10]porte1/0/1
[R0-vlan10]vlan 20
[R0-vlan20]porte1/0/2
[R0-vlan20]int vlan 10
[R0-Vlan-interface10]ip add 10.1.1.10 24
[R0-Vlan-interface10]int vlan 20
[R0-Vlan-interface20]ip add 20.1.1.20 24
[R0]ip route-static 1.1.1.1 32 10.1.1.1
[R0]ip route-static 2.2.2.2 32 20.1.1.2
[SW]ip route-static 11.1.1.1 32 10.1.1.1
[SW]ip route-static 22.2.2.2 32 20.1.1.2