【实验】一个MPLS L3VPN的问题:分支站点之间的数据必须经过中心站点

【实验】一个MPLS VPN的问题:分支站点之间的数据必须经过中心站点
【实验】一个MPLS VPN的问题:分支站点之间的数据必须经过中心站点

实验需求:

IOU8访问IOU9,需要这么走:IOU8->IOU1->IOU3->IOU5->IOU6->IOU7->IOU6->IOU5->IOU4->IOU2->IOU9

实验环境:

操作系统:Mac OS X 10.11.4 beta 5(当时最新测试版),模拟器:GNS3 IOU for Mac 1.4.4(当时最新版本)
注:当然,只要有思科模拟器都可以做这个实验

思路:

  • 这个需求主要使用RT值来控制路由。
  • IOU6导出一个0:0,导入一个12:12,然后IOU3和IOU4均导入0:0,R4导出12:12。
  • 然后IOU7下发默认路由,这样默认路由就通过0:0分别到达了IOU1和IOU2,所以IOU1和IOU2的数据包都会发往中心站点IOU7。
  • 因为IOU7都有这两个分支站点的路由,所以能帮助这两个分支站点传递数据包。

实验步骤:(PC上观看效果更佳)

1、配置IP地址和Lo 0口:

IOU1:

int e 0/0
ip add 13.1.1.1 255.255.255.0
no sh

int e 0/1
ip add 18.1.1.1 255.255.255.0
no sh

int l 0
ip add 1.1.1.1 255.255.255.255

IOU2:

int e 0/0
ip add 24.1.1.2 255.255.255.0
no sh

int e 0/1
ip add 29.1.1.2 255.255.255.0
no sh

int l 0
ip add 2.2.2.2 255.255.255.255

IOU3:

int e 0/0
ip add 13.1.1.3 255.255.255.0
no sh

int e 0/2
ip add 35.1.1.3 255.255.255.0
no sh

int l 0
ip add 3.3.3.3 255.255.255.255

IOU4:

int e 0/0
ip add 24.1.1.4 255.255.255.0
no sh

int e 0/1
ip add 45.1.1.4 255.255.255.0
no sh

int l 0
ip add 4.4.4.4 255.255.255.255

IOU5:

int e 0/2
ip add 35.1.1.5 255.255.255.0
no sh

int e 0/1
ip add 45.1.1.5 255.255.255.0
no sh

int e 0/0
ip add 56.1.1.5 255.255.255.0
no sh

int l 0
ip add 5.5.5.5 255.255.255.255

IOU6:

int e 0/1
ip add 67.1.1.6 255.255.255.0
no sh

int e 0/0
ip add 56.1.1.6 255.255.255.0
no sh

int l 0
ip add 6.6.6.6 255.255.255.255

IOU7:

int e 0/1
ip add 67.1.1.7 255.255.255.0
no sh

int l 0
ip add 7.7.7.7 255.255.255.255

IOU8:

int e 0/1
ip add 18.1.1.8 255.255.255.0
no sh

int l 0
ip add 8.8.8.8 255.255.255.255

IOU9:

int e 0/1
ip add 29.1.1.9 255.255.255.0
no sh

int l 0
ip add 9.9.9.9 255.255.255.255

2、配置OSPF 3456:

IOU3:

router ospf 3456
router-id 3.3.3.3

int r e 0/2 , l 0
ip os 3456 a 0

IOU4:

router ospf 3456
router-id 4.4.4.4

int r e 0/1 , l 0
ip os 3456 a 0

IOU5:

router ospf 3456
router-id 5.5.5.5

int r e 0/0-2 , l 0
ip os 3456 a 0

IOU6:

router ospf 3456
router-id 6.6.6.6

int r e 0/0 , l 0
ip os 3456 a 0

3、配置MPLS:

IOU3:

ip cef
mpls ip
mpls label pro ldp
mpls ldp ro l 0 force

int e 0/2
mpls ip

IOU4:

ip cef
mpls ip
mpls label pro ldp
mpls ldp ro l 0 force

int e 0/1
mpls ip

IOU5:

ip cef
mpls ip
mpls label pro ldp
mpls ldp ro l 0 force

int r e 0/0-2
mpls ip

IOU6:

ip cef
mpls ip
mpls label pro ldp
mpls ldp ro l 0 force

int e 0/0
mpls ip

4、配置VRF:

IOU3:

ip vrf IOU1
rd 3456:1
route-target import 0:0
route-target export 12:12

int e 0/0
ip vrf f IOU1
ip add 13.1.1.3 255.255.255.0

IOU4:

ip vrf IOU2
rd 3456:2
route-target import 0:0
route-target export 12:12

int e 0/0
ip vrf f IOU2
ip add 24.1.1.4 255.255.255.0

IOU6:

ip vrf IOU7
rd 3456:7
route-target export 0:0
route-target import 12:12

int e 0/1
ip vrf f IOU7
ip add 67.1.1.6 255.255.255.0

5、开启MP-BGP:

IOU3:

router bgp 3456
bgp router-id 3.3.3.3
no bgp def ipv4-unicast
nei 5.5.5.5 remot 3456
nei 5.5.5.5 up l 0
add vpnv4 un
nei 5.5.5.5 ac

IOU4:

router bgp 3456
bgp router-id 4.4.4.4
no bgp def ipv4-unicast
nei 5.5.5.5 remot 3456
nei 5.5.5.5 up l 0
add vpnv4 un
nei 5.5.5.5 ac

IOU5:

router bgp 3456
bgp router-id 5.5.5.5
no bgp def ipv4-unicast
nei iBGP peer
nei iBGP remot 3456
nei iBGP up l 0
nei 3.3.3.3 peer iBGP
nei 4.4.4.4 peer iBGP
nei 6.6.6.6 peer iBGP
add vpnv4 un
nei iBGP route-reflector-client
nei 3.3.3.3 ac
nei 4.4.4.4 ac
nei 6.6.6.6 ac

IOU6:

router bgp 3456
bgp router-id 6.6.6.6
no bgp def ipv4-unicast
nei 5.5.5.5 remot 3456
nei 5.5.5.5 up l 0
add vpnv4 un
nei 5.5.5.5 ac

6、配置PE:

IOU3:

router eigrp 138
add ipv4 vrf IOU1 autonomous-system 138
net 13.1.1.3 0.0.0.0
red bgp 3456 metric 10000 10 255 1 1500

router bgp 3456
add ipv4 vrf IOU1
red eigrp 138

IOU4:

router eigrp 249
add ipv4 vrf IOU2 autonomous-system 249
net 24.1.1.4 0.0.0.0
red bgp 3456 metric 10000 10 255 1 1500

router bgp 3456
add ipv4 vrf IOU2
red eigrp 249

IOU6:

router bgp 3456
add ipv4 vrf IOU7
nei 67.1.1.7 remot 67

7、配置CE:

IOU1:

router eigrp 138
no au
net 13.1.1.1 0.0.0.0
net 18.1.1.1 0.0.0.0

IOU8:
router eigrp 138
no au
net 8.8.8.8 0.0.0.0
net 18.1.1.8 0.0.0.0
IOU2:

router eigrp 249
no au
net 24.1.1.2 0.0.0.0
net 29.1.1.2 0.0.0.0

IOU9:

router eigrp 249
no au
net 9.9.9.9 0.0.0.0
net 29.1.1.9 0.0.0.0

IOU7:

router bgp 67
bgp router-id 7.7.7.7
no bgp def ipv4-unicast
nei 67.1.1.6 remot 3456
add ipv4 un
nei 67.1.1.6 ac
nei 67.1.1.6 default-originate

实验结果:

IOU8#tra 9.9.9.9 so l 0
Type escape sequence to abort.
Tracing the route to 9.9.9.9
VRF info: (vrf in name/id, vrf out name/id)
  1 18.1.1.1 0 msec 1 msec 4 msec
  2 13.1.1.3 1 msec 1 msec 0 msec
  3 35.1.1.5 [MPLS: Labels 18/16 Exp 0] 0 msec 0 msec 5 msec
  4 67.1.1.6 [MPLS: Label 16 Exp 0] 1 msec 5 msec 6 msec
  5 67.1.1.7 1 msec 4 msec 5 msec
  6 67.1.1.6 5 msec 1 msec 1 msec
  7 56.1.1.5 [MPLS: Labels 17/16 Exp 0] 5 msec 6 msec 3 msec
  8 24.1.1.4 [MPLS: Label 16 Exp 0] 3 msec 9 msec 3 msec
  9 24.1.1.2 1 msec 1 msec 2 msec
 10 29.1.1.9 2 msec 1 msec 1 msec

符合预期:IOU8->IOU1->IOU3->IOU5->IOU6->IOU7->IOU6->IOU5->IOU4->IOU2->IOU9

本文完。如有疑问,欢迎在下方留言;如本文有什么错误,欢迎在下方留言指正,谢谢。

这篇文章对你有帮助吗?

相关文章

发表评论?

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据