Routing with VRF Lite.
I have followed some blogs with experts in the market available and cisco official documentation :
I have simple topology testing :
Config file is attached below :
ISP
ip vrf Blue
rd 65000:3
!
ip vrf Green
rd 65000:2
route-target export 65000:2
route-target import 65000:99
!
ip vrf Red
rd 65000:1
route-target export 65000:1
route-target import 65000:99
!
ip vrf Shared
rd 65000:99
route-target export 65000:99
route-target import 65000:1
route-target import 65000:2
!
interface Loopback0
ip address 192.0.2.1 255.255.255.255
!
interface Loopback99
description VOIP Services
ip vrf forwarding Shared
ip address 192.168.99.1 255.255.255.0
!
interface GigabitEthernet0/0
switchport trunk encapsulation dot1q
switchport mode trunk
negotiation auto
!
interface GigabitEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
negotiation auto
!
interface GigabitEthernet0/2
no switchport
ip vrf forwarding Red
ip address 172.16.1.2 255.255.255.252
negotiation auto
!
interface GigabitEthernet0/3
no switchport
ip vrf forwarding Green
ip address 172.17.1.2 255.255.255.252
negotiation auto
!
interface GigabitEthernet1/0
no switchport
ip vrf forwarding Blue
ip address 172.18.1.2 255.255.255.252
negotiation auto
!
interface Vlan16
ip vrf forwarding Red
ip address 172.16.0.1 255.255.255.0
!
interface Vlan17
ip vrf forwarding Green
ip address 172.17.0.1 255.255.255.0
!
interface Vlan18
ip vrf forwarding Blue
ip address 172.18.0.1 255.255.255.0
!
router ospf 1 vrf Red
redistribute bgp 65000 subnets
network 0.0.0.0 255.255.255.255 area 0
!
router ospf 2 vrf Green
redistribute bgp 65000 subnets
network 0.0.0.0 255.255.255.255 area 0
!
router ospf 3 vrf Blue
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 65000
bgp log-neighbor-changes
!
address-family ipv4 vrf Blue
redistribute connected
redistribute ospf 3
exit-address-family
!
address-family ipv4 vrf Green
redistribute connected
redistribute ospf 2
exit-address-family
!
address-family ipv4 vrf Red
redistribute connected
redistribute ospf 1
exit-address-family
!
address-family ipv4 vrf Shared
redistribute connected
exit-address-family
!
CUSTA
ip vrf Green
rd 65000:2
!
ip vrf Red
rd 65000:1
!
interface GigabitEthernet0/0
switchport trunk encapsulation dot1q
switchport mode trunk
negotiation auto
!
interface Vlan16
ip vrf forwarding Red
ip address 172.16.0.2 255.255.255.0
!
interface Vlan17
ip vrf forwarding Green
ip address 172.17.0.2 255.255.255.0
!
interface Vlan216
ip vrf forwarding Red
ip address 172.16.2.1 255.255.255.0
!
interface Vlan217
ip vrf forwarding Green
ip address 172.17.2.1 255.255.255.0
!
router ospf 1 vrf Red
passive-interface Vlan216
network 0.0.0.0 255.255.255.255 area 0
!
router ospf 2 vrf Green
passive-interface Vlan217
network 0.0.0.0 255.255.255.255 area 0
!
CUSTB
ip vrf Blue
rd 65000:3
!
ip vrf Red
rd 65000:1
!
!
interface GigabitEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
negotiation auto
!
interface Vlan16
ip vrf forwarding Red
ip address 172.16.0.3 255.255.255.0
!
interface Vlan18
ip vrf forwarding Blue
ip address 172.18.0.3 255.255.255.0
!
interface Vlan316
ip vrf forwarding Red
ip address 172.16.3.1 255.255.255.0
!
interface Vlan318
ip vrf forwarding Blue
ip address 172.18.3.1 255.255.255.0
!
router ospf 1 vrf Red
passive-interface Vlan316
network 0.0.0.0 255.255.255.255 area 0
!
router ospf 3 vrf Blue
passive-interface Vlan318
network 0.0.0.0 255.255.255.255 area 0
Verifications :
CUSTB verifications :
Now I do not see redistributed routes
After a struggle of 1 hour and cisco docs, I found I have not added the VRF-lite capabilities
CUST A :
router ospf 1 vrf Red
capability vrf-lite
passive-interface Vlan216
network 0.0.0.0 255.255.255.255 area 0
CUSTB:
router ospf 1 vrf Red
capability vrf-lite
passive-interface Vlan316
network 0.0.0.0 255.255.255.255 area 0
Now verification works as expected :
Good luck to whoever ever struggling with the same issue…!
Happy Labbbing…………………………….!