五、验证配置结果
# 检查Device A上查看OSPF联动BFD处于UP状态。
Device A# show ip ospf neighbor
OSPF process 1, 1 Neighbors, 1 is Full:
Neighbor ID Pri State BFD State Dead Time Address Interface
192.168.1.2 1 Full/BDR Up 00:00:40 192.168.1.2 GigabitEthernet 0/1
192.168.13.3 1 Full/BDR Up 00:00:40 192.168.13.3 GigabitEthernet 0/2
# 检查Device B上查看OSPF联动BFD处于UP状态。
Device B# show ip ospf neighbor
OSPF process 1, 1 Neighbors, 1 is Full:
Neighbor ID Pri State BFD State Dead Time Address Interface
192.168.1.1 1 Full/BDR Up 00:00:40 192.168.1.1 GigabitEthernet 0/1
192.168.13.3 1 Full/BDR Up 00:00:40 192.168.23.3
# Device C的配置。
Device C(config)# router rip
Device C(config-router)# version 2
Device C(config-router)# no auto-summary
Device C(config-router)# network 0.0.0.0 255.255.255.255
Device C(config-router)# passive-interface default
Device C(config-router)# no passive-interface gigabitethernet 0/1
五、验证配置结果
# 检查A、B和C上的IP路由表,应看到RIP学到了远端网络的路由。
●Device A
Device A# show ip route
Codes: C – connected, S – static, R – RIP, B – BGP
O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, * – candidate default
Gateway of last resort is no set
C 110.11.2.0/24 is directly connected, GigabitEthernet 0/1
C 110.11.2.1/32 is local host.
R 117.0.0.0/8 [120/1] via 110.11.2.2, 00:00:47, GigabitEthernet 0/1
C 155.10.1.0/24 is directly connected, GigabitEthernet 0/2
C 155.10.1.1/32 is local host.
C 192.168.217.0/24 is directly connected, VLAN 1
C 192.168.217.233/32 is local host.
R 196.38.165.0/24 [120/1] via 110.11.2.3, 00:19:18, GigabitEthernet 0/1
●Device B
Device B# show ip route
Codes: C – connected, S – static, R – RIP, B – BGP
O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, * – candidate default
Gateway of last resort is no set
C 110.11.2.0/24 is directly connected, GigabitEthernet 0/1
C 110.11.2.2/32 is local host.
R 155.10.0.0/16 [120/1] via 110.11.2.1, 00:15:21, GigabitEthernet 0/1
C 196.38.165.0/24 is directly connected, GigabitEthernet 0/2
C 196.38.165.1/32 is local host.
R 117.0.0.0/8 [120/1] via 110.11.2.2, 00:00:47, GigabitEthernet 0/1
●Device C
Device C# show ip route
Codes: C – connected, S – static, R – RIP, B – BGP
O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, * – candidate default
Gateway of last resort is no set
C 110.11.2.0/24 is directly connected, GigabitEthernet 0/1
C 110.11.2.3/32 is local host.
C 117.102.0.0/16 is directly connected, GigabitEthernet 0/2
C 117.102.0.1/32 is local host.
R 155.10.0.0/16 [120/1] via 110.11.2.1, 00:20:55, GigabitEthernet 0/1
R 196.38.165.0/24 [120/1] via 110.11.2.3, 00:19:18, GigabitEthernet 0/1
六、配置文件
● 设备A的配置文件。
!
interface gigabitethernet 0/1
no switchport
ip address 110.11.2.1 255.255.255.0
!
interface gigabitethernet 0/2
no switchport
ip address 155.10.1.1 255.255.255.0
!
router rip
version 2
passive-interface default
no passive-interface gigabitethernet 0/1
network 0.0.0.0
!
●设备B的配置文件。
!
interface gigabitethernet 0/1
no switchport
ip address 110.11.2.2 255.255.255.0
!
interface gigabitethernet 0/2
no switchport
ip address 196.38.165.1 255.255.255.0
!
router rip
version 2
passive-interface default
no passive-interface gigabitethernet 0/1
network 0.0.0.0
!
● 设备C的配置文件。
!
interface gigabitethernet 0/1
no switchport
ip address 110.11.2.3 255.255.255.0
!
interface gigabitethernet 0/2
no switchport
ip address 117.102.0.1 255.255.255.0
!
router rip
version 2
no auto-summary
passive-interface default
no passive-interface gigabitethernet 0/1
network 0.0.0.0
! 七、常见错误
●接口上未配置IPv4地址。
● 某台设备上没有定义RIP版本,或RIP版本号与其他设备不一致。
● network命令配置的地址范围未覆盖某接口。
● network命令参数IP地址比较比特位配置错误。0表示精确匹配,1表不做比较。
● 设备互联接口被设置为被动接口。
五、 验证配置结果
# Device A上检查路由表,可以查到10.3.3.0/24的RIP路由,度量值为6。
Device A# show ip route rip
R 10.3.3.0/24 [120/6] via 192.168.12.2, 00:06:11, GigabitEthernet 0/1
五. 验证配置结果
# 显示Device A上的主备路由。
Device A# show ip route fast-reroute
Codes: C – connected, S – static, R – RIP, B – BGP
O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, * – candidate default
Status codes: m – main entry, b – backup entry, a – active entry
Gateway of last resort is no set
S 1.1.3.0 /24 [ma] via 1.1.13.3, GigabitEthernet 0/3
[b] via 1.1.12.2, GigabitEthernet 0/2
六、配置文件
●Device A的配置文件。
!
route-map fast-reroute
set fast-reroute backup-interface gigabitethernet 0/2 backup-nexthop 1.1.12.2
!
ip fast-reroute static route-map fast-reroute
!
五、验证配置结果
# 查看BFD邻居状态。
Device A# show bfd neighbors
OurAddr NeighAddr LD/RD RH/RS Holdown(mult) State Int
1.1.12.1 1.1.12.2 8192/0 Up 0(3 ) Up GigabitEthernet 0/1
# 检查设查看BFD邻居状态。
Device A# show ip route static bfd
S 1.1.2.0/24 via 1.1.12.2, GigabitEthernet 0/1, BFD state is Up
五、验证配置结果
# 查看Track 2统计信息。
Device A# show track 2
Track 2
Interface gigabitEthernet 0/1
The state is Up, delayed Down (5 secs remaining)
1 change, current state last: 300 secs
Delay up 0 secs, down 0 secs
# 查看IP路由联动Track信息与状态。
Device A# show ip route track-table
ip route 1.1.2.0 255.0.0.0 GigabitEthernet 0/1 1.1.12.2 track 2 up
五、验证配置结果
检查设备的路由表,确认有静态路由条目。
# Device A的路由表。
Device A# show ip route
Codes: C – Connected, L – Local, S – Static
R – RIP, O – OSPF, B – BGP, I – IS-IS
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
SU – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
IA – Inter area, * – candidate default
Gateway of last resort is no set
C 1.1.1.0/24 is directly connected, GigabitEthernet 0/0
C 1.1.1.1/32 is local host.
S 1.1.2.0/24 [1/0] via 1.1.12.2, GigabitEthernet 0/2
S 1.1.3.0/24 [1/0] via 1.1.13.3, GigabitEthernet 0/2
C 1.1.12.0/24 is directly connected, GigabitEthernet 0/2
C 1.1.12.1/32 is local host.
C 1.1.13.0/24 is directly connected, GigabitEthernet 0/3
C 1.1.13.1/32 is local host.
# Device B的路由表。
Device B# show ip route
Codes: C – Connected, L – Local, S – Static
R – RIP, O – OSPF, B – BGP, I – IS-IS
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
SU – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
IA – Inter area, * – candidate default
Gateway of last resort is no set
S 1.1.1.0/24 [1/0] via 1.1.12.1, GigabitEthernet 0/0
C 1.1.2.0/24 is directly connected, GigabitEthernet 0/0
C 1.1.2.1/32 is local host.
S 1.1.3.0/24 [1/0] via 1.1.23.3, GigabitEthernet 0/3
C 1.1.12.0/24 is directly connected, GigabitEthernet 0/1
C 1.1.12.2/32 is local host.
C 1.1.23.0/24 is directly connected, GigabitEthernet 0/3
C 1.1.23.2/32 is local host.
# Device C的路由表。
Device C# show ip route
Codes: C – Connected, L – Local, S – Static
R – RIP, O – OSPF, B – BGP, I – IS-IS
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
SU – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
IA – Inter area, * – candidate default
Gateway of last resort is no set
S 1.1.1.0/24 [1/0] via 1.1.13.1, GigabitEthernet 0/2
S 1.1.2.0/24 [1/0] via 1.1.23.2, GigabitEthernet 0/2
C 1.1.3.0/24 is directly connected, GigabitEthernet 0/0
C 1.1.3.1/32 is local host.
C 1.1.13.0/24 is directly connected, GigabitEthernet 0/1
C 1.1.13.3/32 is local host.
C 1.1.23.0/24 is directly connected, GigabitEthernet 0/2
C 1.1.23.3/32 is local host.
六、 配置文件
● Device A的配置文件。
!
interface gigabitethernet 0/0
ip address 1.1.1.1 255.255.255.
!
interface gigabitethernet 0/2
ip address 1.1.12.1 255.255.255.0
!
interface gigabitethernet 0/3
ip address 1.1.13.1 255.255.255.0
!
ip route 1.1.2.0 255.255.255.0 GigabitEthernet 0/2 1.1.12.2
ip route 1.1.3.0 255.255.255.0 GigabitEthernet 0/3 1.1.13.3
!
● Device B的配置文件。
!
interface gigabitethernet 0/0
ip address 1.1.2.1 255.255.255.0
!
interface gigabitethernet 0/1
ip address 1.1.12.2 255.255.255.0
!
interface gigabitethernet 0/3
ip address 1.1.23.2 255.255.255.0
!
ip route 1.1.1.0 255.255.255.0 GigabitEthernet 0/1 1.1.12.1
ip route 1.1.3.0 255.255.255.0 GigabitEthernet 0/3 1.1.23.3
!
● Device C的配置文件。
!
interface gigabitethernet 0/0
ip address 1.1.3.1 255.255.255.0
!
interface gigabitethernet 0/1
ip address 1.1.13.3 255.255.255.0
!
interface gigabitethernet 0/2
ip address 1.1.23.3 255.255.255.0
!
ip route 1.1.2.0 255.255.255.0 GigabitEthernet 0/2 1.1.23.2
ip route 1.1.1.0 255.255.255.0 GigabitEthernet 0/1 1.1.13.1
!