Cisco XR und IOS und OSPF

OSPF in Verbindung mit Cisco XR und IOS


Konfiguration

XR1

hostname XR1
!
interface Loopback0
ipv4 address 192.168.1.1 255.255.255.255
!
interface MgmtEth0/0/CPU0/0
shutdown
!
interface GigabitEthernet0/0/0/0
ipv4 address 10.1.1.1 255.255.255.0
loopback internal
!
interface GigabitEthernet0/0/0/2
ipv4 address 10.123.4.1 255.255.255.0
!
router ospf 1
router-id 192.168.1.1
passive enable
area 0
interface Loopback0
!
interface GigabitEthernet0/0/0/0
!
interface GigabitEthernet0/0/0/2
passive disable
!
!
!

R2

!
hostname R2
!
!
interface Loopback0
ip address 192.168.2.2 255.255.255.255
!
interface GigabitEthernet0/0
ip address 10.123.4.2 255.255.255.0
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/1
ip address 10.2.2.2 255.255.255.0
duplex auto
speed auto
media-type rj45
!
router ospf 1
router-id 192.168.2.2
passive-interface GigabitEthernet0/1
passive-interface Loopback0
network 10.2.2.2 0.0.0.0 area 0
network 10.123.4.2 0.0.0.0 area 0
network 192.168.2.2 0.0.0.0 area 0
!
ip forward-protocol nd
!

R3

!
hostname R3
!
interface Loopback0
ip address 192.168.3.3 255.255.255.255
!
interface GigabitEthernet0/0
ip address 10.123.4.3 255.255.255.0
ip ospf 1 area 0
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/1
ip address 10.3.3.3 255.255.255.0
ip ospf 1 area 0
duplex auto
speed auto
media-type rj45
!
router ospf 1
router-id 192.168.3.3
passive-interface default
no passive-interface GigabitEthernet0/0
!
ip forward-protocol nd
!


CR2


!
hostname XR2
interface Loopback0
ipv4 address 192.168.4.4 255.255.255.255
!
interface GigabitEthernet0/0/0/0
ipv4 address 10.123.4.4 255.255.255.0
!
interface GigabitEthernet0/0/0/1
ipv4 address 10.4.4.4 255.255.255.0
!
router ospf 1
router-id 192.168.4.4
passive enable
area 0
interface Loopback0
!
interface GigabitEthernet0/0/0/0
passive disable
!
interface GigabitEthernet0/0/0/1
!
!
!
!

Überprüfen der Interfaces die am OSPF Prozess teilnehmen

XR

RP/0/0/CPU0:ios#sh ospf interface brief
Tue Jul 25 17:26:27.002 UTC

* Indicates MADJ interface, (P) Indicates fast detect hold down state

Interfaces for OSPF 1

Interface PID Area IP Address/Mask Cost State Nbrs F/C
Lo0 1 0 192.168.1.1/32 1 LOOP 0/0
Gi0/0/0/0 1 0 10.1.1.1/24 1 DR 0/0
Gi0/0/0/2 1 0 10.123.4.1/24 1 DR 3/3

R2
R2#sh ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Lo0 1 0 192.168.2.2/32 1 LOOP 0/0
Gi0/0 1 0 10.123.4.2/24 1 BDR 3/3

R3

R3#sh ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Gi0/0 1 0 10.123.4.3/24 1 DROTH 2/3
Gi0/1 1 0 10.3.3.3/24 1 DR 0/0

XR2
RP/0/0/CPU0:XR2#sh ospf interface brief
Thu Jul 27 15:58:51.659 UTC

* Indicates MADJ interface, (P) Indicates fast detect hold down state

Interfaces for OSPF 1

Interface PID Area IP Address/Mask Cost State Nbrs F/C
Lo0 1 0 192.168.4.4/32 1 LOOP 0/0
Gi0/0/0/0 1 0 10.123.4.4/24 1 DROTH 2/3
Gi0/0/0/1 1 0 10.4.4.4/24 1 DR 0/0

Die OSPF Nachbarschaften überprüfen

XR

RP/0/0/CPU0:ios#show ospf neighbor
Tue Jul 25 17:29:06.761 UTC

* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up

Neighbors for OSPF 1

Neighbor ID Pri State Dead Time Address Interface
192.168.2.2 1 FULL/BDR 00:00:34 10.123.4.2 GigabitEthernet0/0/0/2
Neighbor is up for 00:19:38
192.168.3.3 1 FULL/DROTHER 00:00:33 10.123.4.3 GigabitEthernet0/0/0/2
Neighbor is up for 00:12:55
192.168.4.4 1 FULL/DROTHER 00:00:39 10.123.4.4 GigabitEthernet0/0/0/2
Neighbor is up for 00:14:53

Total neighbor count: 3

R2

R2#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
192.168.1.1 1 FULL/DR 00:00:33 10.123.4.1 GigabitEthernet0/0
192.168.3.3 1 FULL/DROTHER 00:00:36 10.123.4.3 GigabitEthernet0/0
192.168.4.4 1 FULL/DROTHER 00:00:32 10.123.4.4 GigabitEthernet0/0

R3

R3#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
192.168.1.1 1 FULL/DR 00:00:39 10.123.4.1 GigabitEthernet0/0
192.168.2.2 1 FULL/BDR 00:00:35 10.123.4.2 GigabitEthernet0/0
192.168.4.4 1 2WAY/DROTHER 00:00:38 10.123.4.4 GigabitEthernet0/0

XR2

RP/0/0/CPU0:XR2#sh ospf neighbor
Thu Jul 27 15:59:44.496 UTC

* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up

Neighbors for OSPF 1

Neighbor ID Pri State Dead Time Address Interface
192.168.1.1 1 2WAY/DROTHER 00:00:33 10.123.4.1 GigabitEthernet0/0/0/0
Neighbor is up for 00:11:31
192.168.2.2 1 FULL/BDR 00:00:31 10.123.4.2 GigabitEthernet0/0/0/0
Neighbor is up for 00:11:33
192.168.3.3 1 FULL/DR 00:00:33 10.123.4.3 GigabitEthernet0/0/0/0
Neighbor is up for 00:11:33

Routen überprüfen

RP/0/0/CPU0:XR1#show route ospf
Tue Jul 25 17:42:38.906 UTC

O 10.3.3.0/24 [110/2] via 10.123.4.3, 00:26:27, GigabitEthernet0/0/0/2
O 10.4.4.0/24 [110/2] via 10.123.4.4, 00:28:25, GigabitEthernet0/0/0/2
O 192.168.2.2/32 [110/2] via 10.123.4.2, 00:33:04, GigabitEthernet0/0/0/2
O 192.168.4.4/32 [110/2] via 10.123.4.4, 00:28:25, GigabitEthernet0/0/0/2

R2#sh ip route ospf

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O 10.1.1.0/24 [110/2] via 10.123.4.1, 00:33:36, GigabitEthernet0/0
O 10.3.3.0/24 [110/2] via 10.123.4.3, 00:26:56, GigabitEthernet0/0
O 10.4.4.0/24 [110/2] via 10.123.4.4, 00:28:52, GigabitEthernet0/0
192.168.1.0/32 is subnetted, 1 subnets
O 192.168.1.1 [110/2] via 10.123.4.1, 00:33:36, GigabitEthernet0/0
192.168.4.0/32 is subnetted, 1 subnets
O 192.168.4.4 [110/2] via 10.123.4.4, 00:28:52, GigabitEthernet0/0

R3#sh ip route ospf

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O 10.1.1.0/24 [110/2] via 10.123.4.1, 00:27:38, GigabitEthernet0/0
O 10.4.4.0/24 [110/2] via 10.123.4.4, 00:27:38, GigabitEthernet0/0
192.168.1.0/32 is subnetted, 1 subnets
O 192.168.1.1 [110/2] via 10.123.4.1, 00:27:38, GigabitEthernet0/0
192.168.2.0/32 is subnetted, 1 subnets
O 192.168.2.2 [110/2] via 10.123.4.2, 00:27:38, GigabitEthernet0/0
192.168.4.0/32 is subnetted, 1 subnets
O 192.168.4.4 [110/2] via 10.123.4.4, 00:27:38, GigabitEthernet0/0

RP/0/0/CPU0:XR2#sh route ospf

Thu Jul 27 16:00:17.583 UTC

O 10.1.1.0/24 [110/2] via 10.123.4.1, 00:12:06, GigabitEthernet0/0/0/0
O 10.3.3.0/24 [110/2] via 10.123.4.3, 00:12:06, GigabitEthernet0/0/0/0
O 192.168.1.1/32 [110/2] via 10.123.4.1, 00:12:06, GigabitEthernet0/0/0/0
O 192.168.2.2/32 [110/2] via 10.123.4.2, 00:12:06, GigabitEthernet0/0/0/0

Prüfen von Routen die nicht “bekannt” gegeben werden+

XR1

RP/0/0/CPU0:XR1#sh route 10.4.4.4
Thu Jul 27 15:52:44.633 UTC

Routing entry for 10.4.4.0/24
Known via “ospf 1”, distance 110, metric 2, type intra area
Installed Jul 27 15:48:11.712 for 00:04:32
Routing Descriptor Blocks
10.123.4.4, from 192.168.4.4, via GigabitEthernet0/0/0/2
Route metric is 2
No advertising protos.

XR2

RP/0/0/CPU0:XR2#sh route 10.1.1.1
Thu Jul 27 16:02:15.095 UTC

Routing entry for 10.1.1.0/24
Known via “ospf 1”, distance 110, metric 2, type intra area
Installed Jul 27 15:48:11.253 for 00:14:03
Routing Descriptor Blocks
10.123.4.1, from 192.168.1.1, via GigabitEthernet0/0/0/0
Route metric is 2
No advertising protos.

OSPF Datenbank

RP/0/0/CPU0:XR1#sh ospf database
Thu Jul 27 16:02:49.022 UTC

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

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
192.168.1.1 192.168.1.1 1862 0x80000003 0x00c9df 3
192.168.2.2 192.168.2.2 1895 0x80000003 0x002699 2
192.168.3.3 192.168.3.3 1896 0x80000003 0x00e631 2
192.168.4.4 192.168.4.4 879 0x80000003 0x003658 3

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
10.123.4.3 192.168.3.3 878 0x80000003 0x003545

RP/0/0/CPU0:XR2#sh ospf database
Thu Jul 27 16:03:16.401 UTC

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

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
192.168.1.1 192.168.1.1 1892 0x80000003 0x00c9df 3
192.168.2.2 192.168.2.2 17 0x80000004 0x00249a 2
192.168.3.3 192.168.3.3 1924 0x80000003 0x00e631 2
192.168.4.4 192.168.4.4 905 0x80000003 0x003658 3

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
10.123.4.3 192.168.3.3 906 0x80000003 0x003545

Netzwerktypen im OSPF Bereich

Bisher sind alles Broadcastnetze, also Netze wo es nicht wirklich auf den Traffic ankommt.
Dazu gibt es noch Non-Braodcast, welches meistens WAN Strecken sind und auch Point-to-Point gibt es noch.
Dazu gibt es noch Point-to-Multipoint, was z.b. bei DMVPN eingesetzt wird.