Routage Inter-VRF: VRF Route Leaking
Introduction
Une Infra IP-MPLS sert à connecter à travers un nuage privé plusieurs sites distants sans avoir besoin d’implémenter dans un monde Internet « non stable » et « non securisé » les VPNs classiques (Site-to-site VPNs, Tunnels GREs …).
Le Nuage IP-MPLS est celui privé de l’opérateur ou même de l’organisme privé.
Chaque client (pour un opérateur) ou zone (pour un organisme privé) est mis dans une VRF. La VRF est tout simplement une table de routage indépendante et dédiée à un Client/Zone spécifique.
Les VRFs ne communiquent pas entre eux par défaut. C’est comme les vlans (en analogie avec Layer 2). Un paquet qui sort d’une VRF Client-A ne peut communiquer qu’avec les réseaux distants de la même VRF Client-A (en utilisant les RTs).
Une VRF est caractérisée par un RD local et un RT en import/export distribué et propagé, voir article précédant sur les RTs/RDs.
Le protocole LDP est utilisé pour acheminer les données d’un site à un autre, il est implémenté entre les Ps (Internal Provider Routers) et les PEs (Provider Edge Routers).
Les Ps n’apprennent pas les routes/réseaux des clients (OSPF ou IS-IS).
Les PEs sont interconnectés en utilisant les sessions internes MP-BGP en Full Mesh -généralement. Pour optimiser et ne pas surcharger le Backbone IP-MPLS, les RRs (routes reflectors) sont utilisés.
On note que sans IP-MPLS (que des sessions iBGP montées à travers OSPF), on doit effectuer un Design en FULL-MESH qui inclut tous les Ps-PEs et une config de "next-hop-self" obligatoire si on a un routage eBGP entre CE et PE (car par défaut la NextHop reste inchangée en iBGP). Avec IP-MPLS, pas besoin de faire ça car les vpn4 sont créés en se basant sur les prefixes et les RDs, et les Loopbacks des PEs sont eux-mêmes les NextHops annoncés vers les autres PEs.
Au final, le MPLS évite les full-MESH entre Ps-PEs ainsi que l’utilisation de "next-hop-self".
Le « eBGP » se base sur l’AS-PATH pour détecter les boucles. Exemple : un AS déjà existant sur le Path reçu sur un équipement ayant ce même AS : Block.
Le « iBGP » n’applique pas ce principe entre les PEs en interne car tous les PEs sont dans le même AS : il utilise plutôt l’OSPF pour monter en TCP ses sessions BGPs en End-to-End.
Chaque Interface (ou sous interface, SVI, …) d’un PE est affectée à une unique VRF.
Le « Route Leaking » est la communication/le routage entre deux VRFs différentes. Deux méthodes sont utilisées : soit on implémente un routage direct entre deux Réseaux appartenant à deux VRFs différentes, soit on utilise les RTs en import et export. La deuxième méthode sera présentée dans cet article :)
Lab : Architecture et Matrice des Flux
Quatre VRFs des sites distants (Technique, Commercial, Serveurs et Internet) sont réparties comme suit, l’Infra IP-MPLS étant préconfigurée et prête :
Initialement et par défaut, chaque VRF est isolée ! Elle ne communique qu'avec elle-même ...
Les flux « Inter VRFs » à autoriser dans ce Lab sont les suivants :
• Technique vers tout le monde (Commercial, Serveurs et internet) : OK
• Commercial vers Technique + Internet : OK
• Serveurs vers Technique : OK
• Internet vers Technique + Commercial : OK
Les flux qui restent bloqués sont alors :
• Commercial vers/depuis Serveurs : KO
• Serveurs vers/depuis Internet : KO
Liste des VRFs avec les Imports/Exports à configurer
| Vrf Technique : |
|---|
|
Equipement |
Config RD et RT |
|---|---|
|
R3 |
RD : 65103:103 RT en Import : 65103:1111 (Technique) 65103:2222 (Commercial) 65103:3333 (Serveurs) 65103:4444 (Internet) RT en Export : 65103:1111 (Technique) |
|
R4 |
RD : 65103:104 RT en Import : 65103:1111 (Technique) 65103:2222 (Commercial) 65103:3333 (Serveurs) 65103:4444 (Internet) RT en Export : 65103:1111 (Technique) |
| Vrf Commercial : |
|---|
|
Equipement |
Config RD et RT |
|---|---|
|
R3 |
RD : 65103:203 RT en Import : 65103:2222 (Commercial) 65103:1111 (Technique) 65103:4444 (Internet) RT en Export : 65103:2222 (Commercial) |
|
R4 |
RD : 65103:204 RT en Import : 65103:2222 (Commercial) 65103:1111 (Technique) 65103:4444 (Internet) RT en Export : 65103:2222 (Commercial) |
| Vrf Serveurs : |
|---|
|
Equipement |
Config RD et RT |
|---|---|
|
R2 |
RD : 65103:302 RT en Import : 65103:3333 (Serveurs) 65103:1111 (Technique) RT en Export : 65103:3333 (Serveurs) |
|
R3 |
RD : 65103:303 RT en Import : 65103:3333 (Serveurs) 65103:1111 (Technique) RT en Export : 65103:3333 (Serveurs) |
|
R4 |
RD : 65103:304 RT en Import : 65103:3333 (Serveurs) 65103:1111 (Technique) RT en Export : 65103:3333 (Serveurs) |
| Vrf Internet : |
|---|
|
Equipement |
Config RD et RT |
|---|---|
|
R2 |
RD : 65103:402 RT en Import : 65103:4444 (Internet) 65103:2222 (Commercial) 65103:1111 (Technique) RT en Export : 65103:4444 (Internet) |
Configuration
| R3 : |
|---|
ip vrf Commercial rd 65103:203 route-target export 65103:2222 route-target import 65103:2222 route-target import 65103:1111 route-target import 65103:4444 ! ip vrf Serveurs rd 65103:303 route-target export 65103:3333 route-target import 65103:3333 route-target import 65103:1111 ! ip vrf Technique rd 65103:103 route-target export 65103:1111 route-target import 65103:1111 route-target import 65103:2222 route-target import 65103:3333 route-target import 65103:4444 interface Loopback0 description -Vers Backbone MPLS- ip address 3.3.3.3 255.255.255.255 ip ospf 1 area 0 ! interface Loopback10 ip vrf forwarding Technique ip address 10.10.10.1 255.255.255.255 ip ospf 10 area 0 ! interface Loopback20 ip vrf forwarding Commercial ip address 10.10.20.1 255.255.255.255 ip ospf 20 area 0 ! interface Loopback30 ip vrf forwarding Serveurs ip address 10.10.30.1 255.255.255.255 ip ospf 30 area 0 interface GigabitEthernet0/0 description -Vers Backbone IP-MPLS - ip address 192.168.13.3 255.255.255.0 ip ospf network point-to-point ip ospf 1 area 0 mpls ip ! router ospf 1 router-id 33.33.33.33 log-adjacency-changes ! router ospf 10 vrf Technique log-adjacency-changes redistribute bgp 65103 metric 100 subnets passive-interface Loopback10 ! router ospf 20 vrf Commercial log-adjacency-changes redistribute bgp 65103 metric 102 subnets passive-interface Loopback20 ! router ospf 30 vrf Serveurs log-adjacency-changes redistribute bgp 65103 metric 103 subnets passive-interface Loopback30 ! router bgp 65103 no synchronization bgp log-neighbor-changes neighbor 2.2.2.2 remote-as 65103 neighbor 2.2.2.2 update-source Loopback0 neighbor 4.4.4.4 remote-as 65103 neighbor 4.4.4.4 update-source Loopback0 no auto-summary ! address-family vpnv4 neighbor 2.2.2.2 activate neighbor 2.2.2.2 send-community extended neighbor 4.4.4.4 activate neighbor 4.4.4.4 send-community extended exit-address-family ! address-family ipv4 vrf Technique redistribute ospf 10 vrf Technique metric 11 match internal no synchronization exit-address-family ! address-family ipv4 vrf Commercial redistribute ospf 20 vrf Commercial metric 12 match internal no synchronization exit-address-family ! address-family ipv4 vrf Serveurs redistribute ospf 30 vrf Serveurs metric 13 match internal no synchronization exit-address-family !
| R4 : |
|---|
ip vrf Commercial rd 65103:204 route-target export 65103:2222 route-target import 65103:2222 route-target import 65103:1111 route-target import 65103:4444 ! ip vrf Serveurs rd 65103:304 route-target export 65103:3333 route-target import 65103:3333 route-target import 65103:1111 ! ip vrf Technique rd 65103:104 route-target export 65103:1111 route-target import 65103:1111 route-target import 65103:2222 route-target import 65103:3333 route-target import 65103:4444 ! interface Loopback0 description -Vers Backbone MPLS- ip address 4.4.4.4 255.255.255.255 ip ospf 1 area 0 ! interface Loopback10 ip vrf forwarding Technique ip address 10.10.10.254 255.255.255.255 ip ospf 10 area 0 ! interface Loopback20 ip vrf forwarding Commercial ip address 10.10.20.254 255.255.255.255 ip ospf 20 area 0 ! interface Loopback30 ip vrf forwarding Serveurs ip address 10.10.30.254 255.255.255.255 ip ospf 30 area 0 ! interface GigabitEthernet0/0 description -Vers Backbone MPLS- ip address 192.168.14.4 255.255.255.0 ip ospf network point-to-point ip ospf 1 area 0 mpls ip ! router ospf 10 vrf Technique redistribute bgp 65103 metric 100 subnets passive-interface Loopback10 ! router ospf 20 vrf Commercial redistribute bgp 65103 metric 102 subnets passive-interface Loopback20 ! router ospf 30 vrf Serveurs redistribute bgp 65103 metric 103 subnets passive-interface Loopback30 ! router ospf 1 router-id 44.44.44.44 ! router bgp 65103 no synchronization bgp log-neighbor-changes neighbor 2.2.2.2 remote-as 65103 neighbor 2.2.2.2 update-source Loopback0 neighbor 3.3.3.3 remote-as 65103 neighbor 3.3.3.3 update-source Loopback0 no auto-summary ! address-family vpnv4 neighbor 2.2.2.2 activate neighbor 2.2.2.2 send-community extended neighbor 3.3.3.3 activate neighbor 3.3.3.3 send-community extended exit-address-family ! address-family ipv4 vrf Technique redistribute ospf 10 vrf Technique metric 14 match internal no synchronization exit-address-family ! address-family ipv4 vrf Commercial redistribute ospf 20 vrf Commercial metric 15 match internal no synchronization exit-address-family ! address-family ipv4 vrf Serveurs redistribute ospf 30 vrf Serveurs metric 16 match internal no synchronization exit-address-family
| R2 : |
|---|
ip vrf Internet rd 65103:402 route-target export 65103:4444 route-target import 65103:4444 route-target import 65103:2222 route-target import 65103:1111 ! ip vrf Serveurs rd 65103:302 route-target export 65103:3333 route-target import 65103:3333 route-target import 65103:1111 ! interface Loopback0 description -Vers MPLS Backbone- ip address 2.2.2.2 255.255.255.255 ip ospf 1 area 0 ! interface Loopback30 description PC-Test-Vlan-Serveurs-R2 ip vrf forwarding Serveurs ip address 10.10.30.133 255.255.255.0 ! interface GigabitEthernet0/0 description -Vers MPLS Backbone- ip address 192.168.12.2 255.255.255.0 ip ospf network point-to-point ip ospf 1 area 0 mpls ip ! interface GigabitEthernet1/0 ip vrf forwarding Internet ip address 172.33.33.1 255.255.255.252 negotiation auto ! router ospf 1 router-id 22.22.22.22 log-adjacency-changes ! router bgp 65103 no synchronization bgp log-neighbor-changes neighbor 3.3.3.3 remote-as 65103 neighbor 3.3.3.3 update-source Loopback0 neighbor 4.4.4.4 remote-as 65103 neighbor 4.4.4.4 update-source Loopback0 no auto-summary ! address-family vpnv4 neighbor 3.3.3.3 activate neighbor 3.3.3.3 send-community extended neighbor 4.4.4.4 activate neighbor 4.4.4.4 send-community extended exit-address-family ! address-family ipv4 vrf Serveurs redistribute connected metric 30 no synchronization exit-address-family ! address-family ipv4 vrf Internet redistribute static metric 33 default-information originate no synchronization exit-address-family ! ip route vrf Internet 0.0.0.0 0.0.0.0 172.33.33.2 !
Résultats
| R3 : |
|---|
R3#sh ip route vrf Technique
Routing Table: Technique
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 2.2.2.2 to network 0.0.0.0
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
C 10.10.10.1/32 is directly connected, Loopback10
B 10.10.20.1/32 is directly connected, 01:16:46, Loopback20
B 10.10.30.0/24 [200/30] via 2.2.2.2, 01:01:16
B 10.10.30.1/32 is directly connected, 01:16:16, Loopback30
B 10.10.30.254/32 [200/0] via 4.4.4.4, 01:10:46
B 10.10.20.254/32 [200/0] via 4.4.4.4, 01:10:46
B 10.10.10.254/32 [200/0] via 4.4.4.4, 01:10:46
B* 0.0.0.0/0 [200/33] via 2.2.2.2, 01:34:02
R3#
R3#
R3#sh ip route vrf Commercial
Routing Table: Commercial
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 2.2.2.2 to network 0.0.0.0
10.0.0.0/32 is subnetted, 4 subnets
B 10.10.10.1 is directly connected, 01:17:38, Loopback10
C 10.10.20.1 is directly connected, Loopback20
B 10.10.20.254 [200/0] via 4.4.4.4, 01:10:53
B 10.10.10.254 [200/0] via 4.4.4.4, 01:10:53
B* 0.0.0.0/0 [200/33] via 2.2.2.2, 01:34:09
R3#
R3#
R3#sh ip route vrf Serveurs
Routing Table: Serveurs
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
B 10.10.10.1/32 is directly connected, 01:17:45, Loopback10
B 10.10.30.0/24 [200/30] via 2.2.2.2, 01:01:30
C 10.10.30.1/32 is directly connected, Loopback30
B 10.10.30.254/32 [200/0] via 4.4.4.4, 01:11:00
B 10.10.10.254/32 [200/0] via 4.4.4.4, 01:11:00
R3#
R3#
R3#sh ip route vrf Internet
% IP routing table Internet does not exist
R3#
| R4 : |
|---|
R4#sh ip route vrf Technique
Routing Table: Technique
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 2.2.2.2 to network 0.0.0.0
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
B 10.10.10.1/32 [200/0] via 3.3.3.3, 01:48:52
B 10.10.20.1/32 [200/0] via 3.3.3.3, 01:48:22
B 10.10.30.0/24 [200/30] via 2.2.2.2, 01:32:37
B 10.10.30.1/32 [200/0] via 3.3.3.3, 01:47:37
B 10.10.30.254/32 is directly connected, 01:42:22, Loopback30
B 10.10.20.254/32 is directly connected, 01:42:22, Loopback20
C 10.10.10.254/32 is directly connected, Loopback10
B* 0.0.0.0/0 [200/33] via 2.2.2.2, 02:05:23
R4#
R4#
R4#sh ip route vrf Commercial
Routing Table: Commercial
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 2.2.2.2 to network 0.0.0.0
10.0.0.0/32 is subnetted, 4 subnets
B 10.10.10.1 [200/0] via 3.3.3.3, 01:48:59
B 10.10.20.1 [200/0] via 3.3.3.3, 01:48:29
C 10.10.20.254 is directly connected, Loopback20
B 10.10.10.254 is directly connected, 01:42:29, Loopback10
B* 0.0.0.0/0 [200/33] via 2.2.2.2, 02:05:29
R4#
R4#
R4#sh ip route vrf Serveurs
Routing Table: Serveurs
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
B 10.10.10.1/32 [200/0] via 3.3.3.3, 01:49:05
B 10.10.30.0/24 [200/30] via 2.2.2.2, 01:32:49
B 10.10.30.1/32 [200/0] via 3.3.3.3, 01:47:50
C 10.10.30.254/32 is directly connected, Loopback30
B 10.10.10.254/32 is directly connected, 01:42:35, Loopback10
R4#
R4#
R4#sh ip route vrf Internet
% IP routing table Internet does not exist
R4#
| R2 : |
|---|
R2#sh ip route vrf Technique
% IP routing table Technique does not exist
R2#
R2#sh ip route vrf Commercial
% IP routing table Commercial does not exist
R2#
R2#
R2#sh ip route vrf
R2#sh ip route vrf Serveurs
Routing Table: Serveurs
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
B 10.10.10.1/32 [200/0] via 3.3.3.3, 00:00:30
C 10.10.30.0/24 is directly connected, Loopback30
B 10.10.30.1/32 [200/0] via 3.3.3.3, 00:00:30
B 10.10.30.254/32 [200/0] via 4.4.4.4, 00:00:15
B 10.10.10.254/32 [200/0] via 4.4.4.4, 00:00:15
R2#
R2#
R2#sh ip route vrf Internet
Routing Table: Internet
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 172.33.33.2 to network 0.0.0.0
172.33.0.0/30 is subnetted, 1 subnets
C 172.33.33.0 is directly connected, GigabitEthernet1/0
10.0.0.0/32 is subnetted, 4 subnets
B 10.10.10.1 [200/0] via 3.3.3.3, 01:50:20
B 10.10.20.1 [200/0] via 3.3.3.3, 01:49:35
B 10.10.20.254 [200/0] via 4.4.4.4, 01:43:35
B 10.10.10.254 [200/0] via 4.4.4.4, 01:43:35
S* 0.0.0.0/0 [1/0] via 172.33.33.2
R2#
Quelques Tests de Vérification
Technique vers Internet OK : R3#ping vrf Technique 8.8.8.8 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 16/43/72 ms Commercial vers Internet OK : R3#ping vrf Commercial 8.8.8.8 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 16/43/72 ms Serveurs vers Internet KO : R3#ping vrf Serveurs 8.8.8.8 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) Serveurs vers Commercial KO : R3#ping vrf Serveurs 10.10.20.254 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.10.20.254, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) Serveurs vers Technique OK : R3#ping vrf Serveurs 10.10.10.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms Commercial vers Technique OK : R3#ping vrf Commercial 10.10.10.254 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.10.10.254, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 12/20/36 ms
Ce contenu t’a plu ? T'as trouvé utile ?
Tu peux m’offrir alors un Super Café ☕☕:)
Ton soutien me permet de continuer à créer des ressources gratuites et utiles :)
✔ Soutien volontaire
✔ Aucun abonnement
✔ Paiement 100% sécurisé
🔒 Paiement sécurisé via Stripe
Ajouter un commentaire
Commentaires