Ad Home

VRF Centralizada

Share:

El concepto de de vrf centralizada requiere que se utilice una vrf que permita interconectar varias vrfs clientes pero con la restricción de que cada una de ellas solo podrá aprender las redes de la VRF centralizada y no de las demás vrfs.

Para aclararlo mejor la vrf AAA es la centralizada, la vrf BBB y vrf CCC son las vrf clientes.  

Entre BBB y CCC no se aprenden  rutas.


R1

hostname R1
!
! Es necesario utilizar un segundo RT para exportar o importar
! lo importante es que en los clientes se configure al contrario.
!

ip vrf AAA
 rd 333:3 
 route-target export 333:3
 route-target import 111:1
!
interface Loopback0
 ip address 172.16.0.1 255.255.255.255
 ip ospf 1 area 0
!
interface FastEthernet0/0
 ip address 172.16.12.1 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
!
interface FastEthernet0/1
 ip vrf forwarding AAA
 ip address 172.16.13.1 255.255.255.0
!         
router ospf 1
 log-adjacency-changes
!
router bgp 100
 bgp router-id 172.16.0.1
 no bgp default ipv4-unicast
 no bgp default route-target filter
 bgp log-neighbor-changes
 neighbor 172.16.0.2 remote-as 100
 neighbor 172.16.0.2 update-source Loopback0
 !
 address-family vpnv4
 neighbor 172.16.0.2 activate
 neighbor 172.16.0.2 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf AAA
 redistribute connected
 neighbor 172.16.13.3 remote-as 333
 neighbor 172.16.13.3 activate
 no synchronization
 exit-address-family
!         
end


R2

hostname R2
!
! configrar los RT en sentido contrario a los de la vrf centralizada
ip vrf BBB
 rd 444:4 
 route-target export 111:1
 route-target import 333:3
!
ip vrf CCC
 rd 666:6
 route-target export 111:1
 route-target import 333:3
!
interface Loopback0
 ip address 172.16.0.2 255.255.255.255
 ip ospf 1 area 0
!
interface FastEthernet0/0
 ip address 172.16.12.2 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
!
interface FastEthernet1/0
 ip vrf forwarding BBB
 ip address 172.16.24.2 255.255.255.0
!
interface FastEthernet1/1
 ip vrf forwarding CCC
 ip address 172.16.26.2 255.255.255.0
!
router ospf 1
 log-adjacency-changes
!
router bgp 100
 bgp router-id 172.16.0.2
 no bgp default ipv4-unicast
 no bgp default route-target filter
 bgp log-neighbor-changes
 neighbor 172.16.0.1 remote-as 100
 neighbor 172.16.0.1 update-source Loopback0
 !
 address-family vpnv4
 neighbor 172.16.0.1 activate
 neighbor 172.16.0.1 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf CCC
 redistribute connected
 neighbor 172.16.26.6 remote-as 666
 neighbor 172.16.26.6 activate
 no synchronization
 exit-address-family
 !
 address-family ipv4 vrf BBB
 redistribute connected
 neighbor 172.16.24.4 remote-as 444
 neighbor 172.16.24.4 activate
 no synchronization
 exit-address-family
!
end



R3

hostname R3
!
interface Loopback1
 ip address 10.3.1.1 255.255.255.0
!         
interface Loopback2
 ip address 10.3.2.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 172.16.13.3 255.255.255.0
!
router ospf 1
 log-adjacency-changes
!
router bgp 333
 no synchronization
 bgp router-id 172.16.13.3
 bgp log-neighbor-changes
 network 10.3.1.0 mask 255.255.255.0
 network 10.3.2.0 mask 255.255.255.0
 neighbor 172.16.13.1 remote-as 100
 no auto-summary
!
end



R4

hostname R4
!
interface Loopback1
 ip address 10.4.1.1 255.255.255.0
!         
interface Loopback2
 ip address 10.4.2.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 172.16.24.4 255.255.255.0
!
router bgp 444
 no synchronization
 bgp router-id 172.16.24.4
 bgp log-neighbor-changes
 network 10.4.1.0 mask 255.255.255.0
 network 10.4.2.0 mask 255.255.255.0
 neighbor 172.16.24.2 remote-as 100
 no auto-summary
!
end



R6

hostname R6
!
interface Loopback1
 ip address 10.6.1.1 255.255.255.0
!         
interface Loopback2
 ip address 10.6.2.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 172.16.26.6 255.255.255.0
 duplex auto
 speed auto
!
router bgp 666
 no synchronization
 bgp router-id 172.16.26.6
 bgp log-neighbor-changes
 network 10.6.1.0 mask 255.255.255.0
 network 10.6.2.0 mask 255.255.255.0
 neighbor 172.16.26.2 remote-as 100
 no auto-summary
!
end


PRUEBAS

vrf AAA aprende todas la redes.

R1#sh ip route vrf AAA

     172.16.0.0/24 is subnetted, 3 subnets
B       172.16.24.0 [200/0] via 172.16.0.2, 00:01:03
B       172.16.26.0 [200/0] via 172.16.0.2, 00:00:03
C       172.16.13.0 is directly connected, FastEthernet0/1
     10.0.0.0/24 is subnetted, 6 subnets
B       10.3.1.0 [20/0] via 172.16.13.3, 00:04:32
B       10.3.2.0 [20/0] via 172.16.13.3, 00:04:32
B       10.4.2.0 [200/0] via 172.16.0.2, 00:01:03
B       10.6.1.0 [200/0] via 172.16.0.2, 00:00:49
B       10.6.2.0 [200/0] via 172.16.0.2, 00:00:49
B       10.4.1.0 [200/0] via 172.16.0.2, 00:01:03

R1#

vrf BBB solo aprende la redes de la vrf AAA.

R2(config-vrf)#do sh ip route vrf BBB

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 2 subnets
C       172.16.24.0 is directly connected, FastEthernet1/0
B       172.16.13.0 [200/0] via 172.16.0.1, 00:00:37
     10.0.0.0/24 is subnetted, 4 subnets
B       10.3.1.0 [200/0] via 172.16.0.1, 00:00:37
B       10.3.2.0 [200/0] via 172.16.0.1, 00:00:37
B       10.4.2.0 [20/0] via 172.16.24.4, 00:00:37
B       10.4.1.0 [20/0] via 172.16.24.4, 00:00:37



vrf CCC solo aprende la redes de la vrf AAA.

R2(config)#do sh ip route vrf CCC

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 2 subnets
C       172.16.26.0 is directly connected, FastEthernet1/1
B       172.16.13.0 [200/0] via 172.16.0.1, 00:01:25
     10.0.0.0/24 is subnetted, 4 subnets
B       10.3.1.0 [200/0] via 172.16.0.1, 00:01:25
B       10.3.2.0 [200/0] via 172.16.0.1, 00:01:25
B       10.6.1.0 [20/0] via 172.16.26.6, 00:01:25
B       10.6.2.0 [20/0] via 172.16.26.6, 00:01:25


Ad Home