本文最后一次被修改是在:2016年11月7日13:43:36
其他相关文章:
- 如果您只是想查看MPLS L3VPN的基础配置,请看:《【实验】MPLS L3VPN详解》;
- 如果您想查看更多关于MPLS L3VPN的内容请在搜索框中搜索:“MPLS L3VPN”。
实验环境:
操作系统:Mac OS X 10.11.4(当时最新正式版),模拟器:GNS3 IOU for Mac 1.4.4(当时最新版本)
注:当然,只要有思科模拟器都可以做这个实验

先根据图中的要求快速完成MPLS L3VPN的配置:
IOU2:
conf t int l 0 int e 0/0 int e 0/1 router os 234 int r e 0/1 , l 0 ip cef int e 0/1 ip vrf IOU1 int e 0/0 |
IOU4:
conf t int l 0 int e 0/0 int e 0/1 router os 234 int r e 0/1 , l 0 ip cef int e 0/1 ip vrf IOU1 int e 0/0 |
IOU3:
conf t int l 0 int e 0/0 int e 0/1 int e 0/2 router os 234 int r e 0/1-2 , l 0 ip cef int r e 0/1-2 ip vrf IOU6 int e 0/0 router bgp 234 add vpnv4 un add ipv4 vrf IOU6 router os 6 vrf IOU6 |
IOU6:
conf t int l 0 int e 0/0 router os 6 |
IOU1:
conf t int l 0 int e 0/0 |
IP地址我的配置习惯是:
- 对于路由器IOUx的Lo 0地址:x.x.x.x /32;
- 对于路由器IOUx和IOUy的直连地址:IOUx 上是 xy.1.1.x /24,IOUy 上是 xy.1.1.y /24,同时x < y。
实验过程:
- 在IOU2和IOU4上开启HSRP;
- 在IOU2和IOU4上写静态路由指向IOU1,并重分布到MPLS L3VPN;
- 在IOU1上写一条静态默认路由指向HSRP虚拟IP地址。
第一步:在IOU2和IOU4上开启HSRP
IOU2:
int e 0/0 standby 1 ip 124.1.1.254 —— 启用HSRP功能,创建standby组1,并设置虚拟网关IP地址 standby 1 preempt —— 设置允许在该路由器优先级是最高时抢占为活动路由器 standby 1 priority 120 —— 设置HSRP的优先级,该值大的会抢占成Active路由器,默认为100
IOU4:
int e 0/0 standby 1 ip 124.1.1.254 standby 1 preempt standby 1 priority 110
第二步:在IOU2和IOU4上写静态路由指向IOU1,并重分布到MPLS L3VPN
IOU2/IOU4:
ip route vrf IOU1 1.1.1.1 255.255.255.255 e 0/0 124.1.1.1 router bgp 234 bgp router-id 2.2.2.2(如果是IOU4这里是bgp router-id 4.4.4.4) no bgp def ipv4 nei 3.3.3.3 remot 234 nei 3.3.3.3 up l 0 add vpnv4 un nei 3.3.3.3 ac add ipv4 vrf IOU1 red static net 124.1.1.0 mask 255.255.255.0
第三步:在IOU1上写一条静态默认路由指向HSRP虚拟IP地址
IOU1:
ip route 0.0.0.0 0.0.0.0 e 0/0 124.1.1.254
实验现象:
IOU1#tra 6.6.6.6 so l 0 Type escape sequence to abort. Tracing the route to 6.6.6.6 VRF info: (vrf in name/id, vrf out name/id) 1 124.1.1.2 5 msec 5 msec 2 msec —— 做成功了 2 36.1.1.3 [MPLS: Label 18 Exp 0] 2 msec 3 msec 3 msec 3 36.1.1.6 1 msec 1 msec 1 msec IOU2#sh standby Ethernet0/0 - Group 1 State is Active 2 state changes, last state change 00:00:47 Virtual IP address is 124.1.1.254 Active virtual MAC address is 0000.0c07.ac01 Local virtual MAC address is 0000.0c07.ac01 (v1 default) Hello time 3 sec, hold time 10 sec Next hello sent in 1.632 secs Preemption enabled Active router is local Standby router is 124.1.1.4, priority 110 (expires in 10.144 sec) Priority 120 (configured 120) Group name is "hsrp-Et0/0-1" (default) IOU2#sh standby neighbors HSRP neighbors on Ethernet0/0 124.1.1.4 No active groups Standby groups: 1 IOU2#sh standby brief P indicates configured to preempt. | Interface Grp Pri P State Active Standby Virtual IP Et0/0 1 120 P Active local 124.1.1.4 124.1.1.254
如有错误,欢迎在下方留言指正,谢谢。
今天(2016年11月7日13:43:36)对本文进行了修改,修改了一个描述性错误。