Cisco VRF OSPFv3 Routing

Anlegen von VRFs und das Routing per OSPF v3
Wenn man die „normale“ Version von OSPF verwendet muss man für jedes VRF eine eigene OSPF Instanz anlegen, das kann bei mehr als zwei oder drei VRFs schnell unübersichtlich werden.
Bei der Verwendung von OSPFv3 braucht man nur eine Instanz
Die PCs haben im entsprechenden Netz immer die .100 als Adresse
Router 1
hostname R1
!
no aaa new-model
!
ip vrf A
description VRF-A
!
ip vrf B
description VRF-B
!
!
no ip domain lookup
!
ipv6 unicast-routing <—- Wichtig !!
!
!
interface GigabitEthernet1
ip vrf forwarding A
ip address 10.1.0.1 255.255.255.0
negotiation auto
ipv6 enable <—- Wichtig !!
ospfv3 1 ipv4 area 0
!
interface GigabitEthernet2
ip vrf forwarding B
ip address 10.1.0.1 255.255.255.0
negotiation auto
ipv6 enable <—- Wichtig !!
ospfv3 1 ipv4 area 0
!
interface GigabitEthernet4
no ip address
negotiation auto
!
interface GigabitEthernet4.2
encapsulation dot1Q 2
ip vrf forwarding A
ip address 10.1.2.1 255.255.255.252
ipv6 enable <—- Wichtig !!
ospfv3 1 ipv4 area 0
!
interface GigabitEthernet4.3
encapsulation dot1Q 3
ip vrf forwarding B
ip address 10.1.2.1 255.255.255.252
ipv6 enable <—- Wichtig !!
ospfv3 1 ipv4 area 0
!
router ospfv3 1
router-id 1.1.1.1
!
address-family ipv4 unicast vrf B
area 0 normal
exit-address-family
!
address-family ipv4 unicast vrf A
area 0 normal
exit-address-family
!
Router 2
hostname R2
!
no aaa new-model
!
ip vrf A
description VRF-A
!
ip vrf B
description VRF-B
!
!
no ip domain lookup
!
ipv6 unicast-routing <—- Wichtig !!
!
!
interface GigabitEthernet1
ip vrf forwarding A
ip address 10.2.0.1 255.255.255.0
negotiation auto
ipv6 enable <—- Wichtig !!
ospfv3 1 ipv4 area 0
!
interface GigabitEthernet2
ip vrf forwarding B
ip address 10.2.0.1 255.255.255.0
negotiation auto
ipv6 enable <—- Wichtig !!
ospfv3 1 ipv4 area 0
!
interface GigabitEthernet4
no ip address
negotiation auto
!
interface GigabitEthernet4.2
encapsulation dot1Q 2
ip vrf forwarding A
ip address 10.1.2.2 255.255.255.252
ipv6 enable <—- Wichtig !!
ospfv3 1 ipv4 area 0
!
interface GigabitEthernet4.3
encapsulation dot1Q 3
ip vrf forwarding B
ip address 10.1.2.2 255.255.255.252
ipv6 enable <—- Wichtig !!
ospfv3 1 ipv4 area 0
!
rrouter ospfv3 1
router-id 2.2.2.2
!
address-family ipv4 unicast vrf B
area 0 normal
exit-address-family
!
address-family ipv4 unicast vrf A
area 0 normal
exit-address-family
!
Überprüfen
Natürlich macht man jedem PC zu dem anderem im VRF ein Ping
Router 1
VRF prüfen
R1#sh vrf
Name Default RD Protocols Interfaces
A ipv4 Gi1
Gi4.2
B ipv4 Gi2
Gi4.3
R1#sh ip protocols vrf A
*** IP Routing is NSF aware ***
Routing Protocol is „ospfv3 1“
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 1.1.1.1
Area border router
Number of areas: 1 normal, 0 stub, 0 nssa
Interfaces (Area 0):
GigabitEthernet4.2
GigabitEthernet1
Maximum path: 4
Routing Information Sources:
Gateway Distance Last Update
2.2.2.2 110 00:23:49
Distance: (default is 110)
R1#sh ip protocols vrf B
*** IP Routing is NSF aware ***
Routing Protocol is „ospfv3 1“
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 1.1.1.1
Area border router
Number of areas: 1 normal, 0 stub, 0 nssa
Interfaces (Area 0):
GigabitEthernet4.3
GigabitEthernet2
Maximum path: 4
Routing Information Sources:
Gateway Distance Last Update
2.2.2.2 110 00:17:54
Distance: (default is 110)
R1#sh ospfv3 vrf A neighbor
OSPFv3 1 address-family ipv4 vrf A (router-id 1.1.1.1)
Neighbor ID Pri State Dead Time Interface ID Interface
2.2.2.2 1 FULL/DR 00:00:35 10 GigabitEthernet4.2
R1#sh ospfv3 vrf B neighbor
OSPFv3 1 address-family ipv4 vrf B (router-id 1.1.1.1)
Neighbor ID Pri State Dead Time Interface ID Interface
2.2.2.2 1 FULL/DR 00:00:34 11 GigabitEthernet4.3
R1#sh ospfv3 vrf A Database
OSPFv3 1 address-family ipv4 vrf A (router-id 1.1.1.1)
Router Link States (Area 0)
ADV Router Age Seq# Fragment ID Link count Bits
1.1.1.1 1550 0x80000007 0 1 B
2.2.2.2 1631 0x80000008 0 1 B
Net Link States (Area 0)
ADV Router Age Seq# Link ID Rtr count
2.2.2.2 1637 0x80000001 10 2
Link (Type-8) Link States (Area 0)
ADV Router Age Seq# Link ID Interface
1.1.1.1 1679 0x80000001 10 Gi4.2
2.2.2.2 1691 0x80000001 10 Gi4.2
1.1.1.1 1940 0x80000001 5 Gi1
Intra Area Prefix Link States (Area 0)
ADV Router Age Seq# Link ID Ref-lstype Ref-LSID
1.1.1.1 1636 0x80000003 0 0x2001 0
2.2.2.2 1637 0x80000003 0 0x2001 0
2.2.2.2 1637 0x80000001 10240 0x2002 10