Voici un petit lab sous GNS3 qui montre l'utilité des VRF (VPN Routing and Forwarding) dans un réseau MPLS.
Le concept de VRF permet à un opérateur de créer plusieurs tables de routage dans un même routeur. Ces tables de routage sont bien sûr étanches entre elles et chacune d'elles est généralement associée à un client.
L'avantage principal des VRF est qu'elles permettent de router le traffic entre les sites appartenant à un même client, alors que plusieurs clients du même opérateur peuvent utiliser le même espace d'adressage !
Voici la topologie que ce lab met en oeuvre.
ClientA possède 2 routeurs R1_A et R2_A.
ClientB possède 2 routeurs R1_B et R2_B.
Le routeur ISP qui connecte les routeurs Clients modélise le nuage opérateur. Dans ce cas de figure, le routeur ISP est appelé PE (Provider Edge).
Et pour tirer parti de la propriété des VRF expliquée précédemment, on va utiliser le même espace d'adressage côté client.
La configuration du routeur ISP est extrêmement simple, voyez plutôt.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 10.1.1.0/24 10.1.1.0./24 +------+ +------+ | R1_A | | R1_B | +------+ +------+ f0/0 \ /f0/0 \.1 .1/ \ / .2\ /.2 f0/0\ /f0/1 +-----+ | ISP | +-----+ f1/0/ \f2/0 .2/ \.2 / \ /.1 .1\ f0/0/ \f0/0 +------+ +------+ | R2_A | | R2_B | +------+ +------+ 10.2.2.0/24 10.2.2.0/24
1) On crée les instances VRF associées aux 2 clients :
La commande rd fixe le Route Descriptor par client, qui permettra au routeur de différencier ses tables de routage.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 ISP(config)#ip vrf ClientA ISP(config-vrf)#rd 1:1 ISP(config-vrf)#ip vrf ClientB ISP(config-vrf)#rd 1:2
2) Puis on configure les interfaces du routeur ISP :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 ISP(config-if)#ip vrf forwarding ClientA ISP(config-if)#ip add 10.1.1.2 255.255.255.0 ISP(config-if)#no shut ISP(config-if)# *Mar 1 00:10:21.403: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up *Mar 1 00:10:22.403: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 ISP(config-if)#int f0/1 ISP(config-if)#ip vrf forwarding ClientB ISP(config-if)#ip add 10.1.1.2 255.255.255.0 ISP(config-if)#no shut ISP(config-if)# *Mar 1 00:11:27.943: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up *Mar 1 00:11:28.943: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 ISP(config-if)#int f1/0 ISP(config-if)#ip vrf forwarding ClientA ISP(config-if)#ip add 10.2.2.2 255.255.255.0 ISP(config-if)#no shut ISP(config-if)# *Mar 1 00:13:03.679: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up *Mar 1 00:13:04.679: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up3) Puis reste à configurer les routeurs clients. C'est du copier/coller puisqu'on prend les mêmes adresses... Par exemple pour R1_A :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 ISP(config-if)#int f2/0 ISP(config-if)#ip vrf forwarding ClientB ISP(config-if)#ip add 10.2.2.2 255.255.255.0 ISP(config-if)#no shut ISP(config-if)# *Mar 1 00:14:08.175: %LINK-3-UPDOWN: Interface FastEthernet2/0, changed state to up *Mar 1 00:14:09.175: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet2/0, changed state to up
Notez que pour les routeurs clients, les VRF utilisés par ISP sont complètement transparents. Je configure donc les interfaces très simplement. Et j'ajoute bien sûr une default route pointant vers ISP.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 R1_A(config)#int f0/0 R1_A(config-if)#ip add 10.1.1.1 255.255.255.0 R1_A(config-if)#no shut R1_A(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.2 R1_A(config)# *Mar 1 00:18:35.063: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up *Mar 1 00:18:36.063: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Voilà, c'est prêt
Quelques tests de connectivité pour vérifier...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 R1_A#ping 10.2.2.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.2.2.1, timeout is 2 seconds: ..!!! Success rate is 60 percent (3/5), round-trip min/avg/max = 8/14/20 msVoyons maintenant quelques commandes sur le routeur ISP.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 R1_B#ping 10.2.2.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.2.2.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/16/24 ms
Résumé des 2 VRF configurées :
Pour afficher les tables de routages associées aux VRF :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 ISP#sh ip vrf Name Default RD Interfaces ClientA 1:1 Fa0/0 Fa1/0 ClientB 1:2 Fa0/1 Fa2/0
Le routeur ISP possède 2 tables de routages distinctes, étanches mais avec les mêmes entrées !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 ISP#sh ip route vrf ClientA Routing Table: ClientA 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/24 is subnetted, 2 subnets C 10.2.2.0 is directly connected, FastEthernet1/0 C 10.1.1.0 is directly connected, FastEthernet0/0 ISP#sh ip route vrf ClientB Routing Table: ClientB 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/24 is subnetted, 2 subnets C 10.2.2.0 is directly connected, FastEthernet2/0 C 10.1.1.0 is directly connected, FastEthernet0/1
Pour pinger une adresse IP à partir du routeur ISP, il faut évidemment préciser la VRF :
De même, si on veut scruter le cache ARP du routeur ISP, il faudra encore une fois préciser la VRF :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 ISP#ping vrf ClientA 10.1.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/5/12 ms ISP#ping vrf ClientB 10.1.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/5/8 ms ISP#ping vrf ClientA 10.2.2.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.2.2.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/12/24 ms ISP# ISP#ping vrf ClientB 10.2.2.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.2.2.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/6/8 ms
La table de routage globale (celle qu'on affiche sans préciser de VRF) est vide :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 ISP#sh ip arp vrf ClientA Protocol Address Age (min) Hardware Addr Type Interface Internet 10.2.2.2 - cc03.0f93.0010 ARPA FastEthernet1/0 Internet 10.1.1.2 - cc03.0f93.0000 ARPA FastEthernet0/0 Internet 10.2.2.1 11 cc07.0f93.0000 ARPA FastEthernet1/0 Internet 10.1.1.1 11 cc08.0f93.0000 ARPA FastEthernet0/0 ISP#sh ip arp vrf ClientB Protocol Address Age (min) Hardware Addr Type Interface Internet 10.2.2.2 - cc03.0f93.0020 ARPA FastEthernet2/0 Internet 10.1.1.2 - cc03.0f93.0001 ARPA FastEthernet0/1 Internet 10.1.1.1 14 cc05.0f93.0000 ARPA FastEthernet0/1 Internet 10.2.2.1 14 cc04.0f93.0000 ARPA FastEthernet2/0
parce que je n'ai configuré du routage que dans des instances VRF. Dans un vrai réseau MPLS, l'opérateur gère un espace d'adressage contenu dans la table de routage globale (ne serait-ce que pour accéder à distance à ses routeurs).
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 ISP#sh ip route sh ip route 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
D'autre part, le routeur ISP est réduit ici à un simple rôle de PE multi-VRF. Dans un vrai réseau MPLS, ce sont bien sûr des dizaines de routeurs connectés entre eux et qui causent MPLS qui permettent de faire la jonction entre R1_A et R1_B par exemple !
Voilà
Steph
Partager