RETO 1: desde VRF AAA importar unicamente la red 10.4.2.0/24 desde vrf BBB
SOLUCIÓN:
R1#
ip vrf AAA
import map AAA-ONLY-R4-2
route-target export 333:3
route-target import 333:3
route-target import 444:4
!
!
ip prefix-list ONLY-R4-2 seq 5 permit 10.4.2.0/24
no cdp log mismatch duplex
!
route-map AAA-ONLY-R4-2 permit 10
match ip address prefix-list ONLY-R4-2
! IMPORTANTE reiniciar el proceso de BGP
R2#clear ip bgp * soft
VERFICACIÓN:
R1#sh ip route vrf AAA
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.13.0 is directly connected, FastEthernet0/1
10.0.0.0/24 is subnetted, 3 subnets
B 10.3.1.0 [20/0] via 172.16.13.3, 01:17:50
B 10.3.2.0 [20/0] via 172.16.13.3, 01:17:50
B 10.4.2.0 [200/0] via 172.16.0.2, 00:00:21
-------------------------------------------------------------------------
SOLUCIÓN:
#R1
ip vrf AAA
rd 333:3
route-target export 333:3
route-target import 333:3
!
#R2
ip vrf BBB
rd 444:4
export map BBB-ONLY-R4-2
route-target export 444:4
route-target import 444:4
!
ip prefix-list ONLY-R4-2 seq 5 permit 10.4.2.0/24
!
route-map BBB-ONLY-R4-2 permit 10
match ip address prefix-list ONLY-R4-2
set extcommunity rt 333:3 additive
! IMPORTANTE reiniciar el proceso de BGP
R2#clear ip bgp * soft
VERIFICACIÓN
R2#sh ip bgp vpnv4 vrf BBB 10.4.2.0
BGP routing table entry for 444:4:10.4.2.0/24, version 12
Paths: (1 available, best #1, table BBB)
Advertised to update-groups:
3
444
172.16.24.4 from 172.16.24.4 (172.16.24.4)
Origin IGP, metric 0, localpref 100, valid, external, best
Extended Community: RT:333:3 RT:444:4
mpls labels in/out 18/nolabel
!Contenido oculto
C 172.16.13.0 is directly connected, FastEthernet0/1
10.0.0.0/24 is subnetted, 5 subnets
B 10.3.1.0 [20/0] via 172.16.13.3, 00:27:16
B 10.3.2.0 [20/0] via 172.16.13.3, 00:27:16
B 10.4.2.0 [200/0] via 172.16.0.2, 00:01:25
R1#
CONFIGURACIÓN BASE
R1
hostname R1
!
ip vrf AAA
rd 333:3
route-target export 333:3
route-target import 333:3
!
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
!
ip vrf AAA
rd 333:3
route-target export 333:3
route-target import 333:3
!
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
!
ip vrf BBB
rd 444:4
route-target export 444:4
route-target import 444:4
!
ip vrf CCC
rd 666:6
route-target export 666:6
route-target import 666:6
!
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
!
ip vrf BBB
rd 444:4
route-target export 444:4
route-target import 444:4
!
ip vrf CCC
rd 666:6
route-target export 666:6
route-target import 666:6
!
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
!
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
!
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
!
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