Cisco Router XR – OSPF

Grundkonfiguration OSPF


hostname Cisco-XR-1
interface Loopback1
ipv4 address 1.1.1.1 255.255.255.255
!
interface Loopback2
ipv4 address 11.11.11.11 255.255.255.255
!
interface MgmtEth0/0/CPU0/0
shutdown
!
interface GigabitEthernet0/0/0/0
ipv4 address 10.10.10.1 255.255.255.252
!
interface GigabitEthernet0/0/0/1
ipv4 address 20.20.20.1 255.255.255.252
!
interface GigabitEthernet0/0/0/2
ipv4 address 30.30.30.1 255.255.255.252
!


hostname Cisco-XR-2
interface Loopback1
ipv4 address 2.2.2.2 255.255.255.255
!
interface Loopback2
ipv4 address 22.22.22.22 255.255.255.255
!
interface MgmtEth0/0/CPU0/0
shutdown
!
interface GigabitEthernet0/0/0/0
ipv4 address 10.10.10.2 255.255.255.252
!
interface GigabitEthernet0/0/0/1
ipv4 address 20.20.20.2 255.255.255.252
!
interface GigabitEthernet0/0/0/2
ipv4 address 30.30.30.2 255.255.255.252
!

OSPF Konfiguration

RP/0/0/CPU0:Cisco-XR-1(config)#router ospf 1
RP/0/0/CPU0:Cisco-XR-1(config-ospf)#router-id 1.1.1.1
RP/0/0/CPU0:Cisco-XR-1(config-ospf)#address-family ipv4 unicast
RP/0/0/CPU0:Cisco-XR-1(config-ospf)#area 0 <--Area festlegen
RP/0/0/CPU0:Cisco-XR-1(config-ospf-ar)#interface gigabitEthernet 0/0/0/0 <-- Interface in Area
RP/0/0/CPU0:Cisco-XR-1(config-ospf-ar-if)#interface gigabitEthernet 0/0/0/1 <-- Interface in Area
RP/0/0/CPU0:Cisco-XR-1(config-ospf-ar-if)#exit
RP/0/0/CPU0:Cisco-XR-1(config-ospf-ar)#exit
RP/0/0/CPU0:Cisco-XR-1(config-ospf)#exit
RP/0/0/CPU0:Cisco-XR-1(config)#commit

OSPF überprüfen auf dem XR-1

RP/0/0/CPU0:Cisco-XR-1#sh ip ospf neighbor

* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up

Neighbors for OSPF 1

Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/BDR 00:00:38 10.10.10.2 GigabitEthernet0/0/0/0
Neighbor is up for 00:00:37
2.2.2.2 1 FULL/BDR 00:00:39 20.20.20.2 GigabitEthernet0/0/0/1
Neighbor is up for 00:00:29

Total neighbor count: 2

Die Verbindung zum Router XR-2 steht

OSPF auf dem XR-2 überprüfen

RP/0/0/CPU0:Cisco-XR-2#sh ip ospf neighbor

* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up

Neighbors for OSPF 1

Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/DR 00:00:34 10.10.10.1 GigabitEthernet0/0/0/0
Neighbor is up for 00:02:09
1.1.1.1 1 FULL/DR 00:00:32 20.20.20.1 GigabitEthernet0/0/0/1
Neighbor is up for 00:02:00

Total neighbor count: 2

Die Verbindung zum XR-1 besteht auch hier

Anschauen der OSPF Konfiguration in der Konfig

RP/0/0/CPU0:Cisco-XR-1#sh run router ospf 1
Sun Dec 17 12:21:20.435 UTC
router ospf 1
router-id 1.1.1.1
address-family ipv4 unicast
area 0
interface GigabitEthernet0/0/0/0
!
interface GigabitEthernet0/0/0/1
!
!
!

Kontrolle von OSPF

Die wichtigsten Befehle sind

Allgemeine Informationen zum OSPF Prozess
show ip protocols
show ip ospf

show ip ospf neighbor
show ip ospf interface
show ip ospf database
show ip route

RP/0/0/CPU0:Cisco-XR-1#sh ip protocols

Routing Protocol OSPF 1
Router Id: 1.1.1.1
Distance: 110
Non-Stop Forwarding: Disabled
Redistribution:
None
Area 0
Loopback1
Loopback2
GigabitEthernet0/0/0/0
GigabitEthernet0/0/0/1

RP/0/0/CPU0:Cisco-XR-1#sh ip ospf
Sun Dec 17 13:04:12.693 UTC

Routing Process “ospf 1” with ID 1.1.1.1
Role: Primary Active
NSR (Non-stop routing) is Enabled
Supports only single TOS(TOS0) routes
Supports opaque LSA
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 50 msecs
Minimum hold time between two consecutive SPFs 200 msecs
Maximum wait time between two consecutive SPFs 5000 msecs
Initial LSA throttle delay 50 msecs
Minimum hold time for LSA throttle 200 msecs
Maximum wait time for LSA throttle 5000 msecs
Minimum LSA interval 200 msecs. Minimum LSA arrival 100 msecs
LSA refresh interval 1800 seconds
Flood pacing interval 33 msecs. Retransmission pacing interval 66 msecs
Adjacency stagger enabled; initial (per area): 2, maximum: 64
Number of neighbors forming: 0, 2 full
Maximum number of configured interfaces 1024
Number of external LSA 0. Checksum Sum 00000000
Number of opaque AS LSA 0. Checksum Sum 00000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
External flood list length 0
SNMP trap is enabled
LSD connected, registered, bound, revision 1
Segment Routing Global Block default (16000-23999), not allocated
Strict-SPF capability is enabled
Area BACKBONE(0)
Number of interfaces in this area is 4
SPF algorithm executed 6 times
Number of LSA 4. Checksum Sum 0x022d26
Number of opaque link LSA 0. Checksum Sum 00000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Number of LFA enabled interfaces 0, LFA revision 0
Number of Per Prefix LFA enabled interfaces 0
Number of neighbors forming in staggered mode 0, 2 full


RP/0/0/CPU0:Cisco-XR-1#sh ip ospf neighbor

Sun Dec 17 13:05:12.109 UTC

* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up

Neighbors for OSPF 1

Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DR 00:00:32 10.10.10.2 GigabitEthernet0/0/0/0
Neighbor is up for 00:02:28
2.2.2.2 1 FULL/DR 00:00:34 20.20.20.2 GigabitEthernet0/0/0/1
Neighbor is up for 00:02:28

RP/0/0/CPU0:Cisco-XR-1#sh ip ospf interface gi 0/0/0/0
Sun Dec 17 13:09:11.203 UTC

GigabitEthernet0/0/0/0 is up, line protocol is up
Internet Address 10.10.10.1/30, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State BDR, Priority 1, MTU 1500, MaxPktSz 1500
Designated Router (ID) 2.2.2.2, Interface address 10.10.10.2
Backup Designated router (ID) 1.1.1.1, Interface address 10.10.10.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:03:224
Index 3/3, flood queue length 0
Next 0(0)/0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
LS Ack List: current length 0, high water mark 2
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2 (Designated Router)
Suppress hello for 0 neighbor(s)
Multi-area interface Count is 0

RP/0/0/CPU0:Cisco-XR-1#sh ip ospf database
Sun Dec 17 12:26:17.095 UTC

OSPF Router with ID (1.1.1.1) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 32 0x80000004 0x00818b 4
2.2.2.2 2.2.2.2 576 0x80000003 0x00e66f 2

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
10.10.10.1 1.1.1.1 584 0x80000001 0x00828b
20.20.20.1 1.1.1.1 575 0x80000001 0x0019d6

RP/0/0/CPU0:Cisco-XR-1#sh ip route
Sun Dec 17 13:10:44.936 UTC

Codes: C – connected, S – static, R – RIP, B – BGP, (>) – Diversion path
D – EIGRP, EX – EIGRP external, 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, E – EGP
i – ISIS, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, su – IS-IS summary null, * – candidate default
U – per-user static route, o – ODR, L – local, G – DAGR, l – LISP
A – access/subscriber, a – Application route
M – mobile route, r – RPL, (!) – FRR Backup path

Gateway of last resort is not set

L 1.1.1.1/32 is directly connected, 00:08:10, Loopback1
C 10.10.10.0/30 is directly connected, 00:08:10, GigabitEthernet0/0/0/0
L 10.10.10.1/32 is directly connected, 00:08:10, GigabitEthernet0/0/0/0
L 11.11.11.11/32 is directly connected, 00:08:10, Loopback2
C 20.20.20.0/30 is directly connected, 00:08:10, GigabitEthernet0/0/0/1
L 20.20.20.1/32 is directly connected, 00:08:10, GigabitEthernet0/0/0/1
C 30.30.30.0/30 is directly connected, 00:08:10, GigabitEthernet0/0/0/2
L 30.30.30.1/32 is directly connected, 00:08:10, GigabitEthernet0/0/0/2


RP/0/0/CPU0:Cisco-XR-1#sh ip ospf route

Sun Dec 17 13:11:10.404 UTC

Topology Table for ospf 1 with ID 1.1.1.1

Codes: O – Intra area, O IA – Inter area
O E1 – External type 1, O E2 – External type 2
O N1 – NSSA external type 1, O N2 – NSSA external type 2

O 1.1.1.1/32, metric 1
1.1.1.1, directly connected, via Loopback1
O 10.10.10.0/30, metric 1
10.10.10.1, directly connected, via GigabitEthernet0/0/0/0
O 11.11.11.11/32, metric 1
11.11.11.11, directly connected, via Loopback2
O 20.20.20.0/30, metric 1
20.20.20.1, directly connected, via GigabitEthernet0/0/0/1