VRF and OSPFv3

VRF and OSPFv3

Virtual Routing Forwarding used to create virtual routing instances in a router.

Configurations:
R1
hostname R1
!
!
ip vrf BLUE
 description BLUE Virtual Forwarding
!
ip vrf RED
 description RED Virtual Forwarding
!
!
interface Ethernet0/0
 description RED Network 10
 ip vrf forwarding RED
 ip address 10.0.0.1 255.255.255.0
 ipv6 enable
 ospfv3 1 ipv4 area 0
 no shutdown
!
interface Ethernet0/1
 description BLUE Network 10
 ip vrf forwarding BLUE
 ip address 10.0.0.1 255.255.255.0
 ipv6 enable
 ospfv3 1 ipv4 area 0
 no shutdown
!
interface Ethernet0/2
 no ip address
 no shutdown
!
interface Ethernet0/2.10
 description RED Network 172
 encapsulation dot1Q 10
 ip vrf forwarding RED
 ip address 172.16.0.1 255.255.255.252
 ipv6 enable
 ospfv3 1 ipv4 area 0
!
interface Ethernet0/2.20
 description BLUE Network 172
 encapsulation dot1Q 20
 ip vrf forwarding BLUE
 ip address 172.16.0.1 255.255.255.252
 ipv6 enable
 ospfv3 1 ipv4 area 0
!
!
router ospfv3 1
 router-id 1.1.1.1
 !
 address-family ipv4 unicast vrf RED
 exit-address-family
 !
 address-family ipv4 unicast vrf BLUE
 exit-address-family
R2
hostname R2
!
!
ip vrf BLUE
 description BLUE Virtual Forwarding
!
ip vrf RED
 description RED Virtual Forwarding
!
!
interface Ethernet0/0
 description RED Network 10
 ip vrf forwarding RED
 ip address 192.168.0.1 255.255.255.0
 ipv6 enable
 ospfv3 1 ipv4 area 0
 no shutdown
!
interface Ethernet0/1
 description BLUE Network 10
 ip vrf forwarding BLUE
 ip address 192.168.0.1 255.255.255.0
 ipv6 enable
 ospfv3 1 ipv4 area 0
 no shutdown
!
interface Ethernet0/2
 no ip address
 no shutdown
!
interface Ethernet0/2.10
 description RED Network 172
 encapsulation dot1Q 10
 ip vrf forwarding RED
 ip address 172.16.0.2 255.255.255.252
 ipv6 enable
 ospfv3 1 ipv4 area 0
!
interface Ethernet0/2.20
 description BLUE Network 172
 encapsulation dot1Q 20
 ip vrf forwarding BLUE
 ip address 172.16.0.2 255.255.255.252
 ipv6 enable
 ospfv3 1 ipv4 area 0
!
!
router ospfv3 1
 router-id 1.1.1.1
 !
 address-family ipv4 unicast vrf RED
 exit-address-family
 !
 address-family ipv4 unicast vrf BLUE
 exit-address-family
Verification
R1#show ip route


Gateway of last resort is not set

R1#show ip route vrf RED

Routing Table: RED


Gateway of last resort is not set

 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/24 is directly connected, Ethernet0/0
L 10.0.0.1/32 is directly connected, Ethernet0/0
 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.0.0/30 is directly connected, Ethernet0/2.10
L 172.16.0.1/32 is directly connected, Ethernet0/2.10
O 192.168.0.0/24 [110/20] via 172.16.0.2, 00:05:59, Ethernet0/2.10


R1#show ip route vrf BLUE

Routing Table: BLUE


Gateway of last resort is not set

 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/24 is directly connected, Ethernet0/1
L 10.0.0.1/32 is directly connected, Ethernet0/1
 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.0.0/30 is directly connected, Ethernet0/2.20
L 172.16.0.1/32 is directly connected, Ethernet0/2.20
O 192.168.0.0/24 [110/20] via 172.16.0.2, 00:06:04, Ethernet0/2.20

Until next post, stay good.

Advertisements

One thought on “VRF and OSPFv3

Comments are closed.