成长值: 64820
|
实验环境:
操作系统:Mac OS X 10.11.4(当时最新正式版),模拟器:GNS3 IOU for Mac 1.4.4(当时最新版本)
注:当然,只要有思科模拟器都可以做这个实验

MPLS L3VPN中关于HSRP的应用
MPLS L3VPN中关于HSRP的应用
先根据图中的要求快速完成MPLS L3VPN的配置:
IOU2:
conf t
int l 0
ip add 2.2.2.2 255.255.255.255
int e 0/0
ip add 124.1.1.2 255.255.255.0
no sh
int e 0/1
ip add 23.1.1.2 255.255.255.0
no sh
router os 234
router-id 2.2.2.2
int r e 0/1 , l 0
ip os 234 a 0
ip cef
mpls ip
mpls label pro ldp
mpls ldp ro l 0 fo
int e 0/1
mpls ip
ip vrf IOU1
rd 234:16
route-target 234:16
int e 0/0
ip vrf f IOU1
ip add 124.1.1.2 255.255.255.0
IOU4:
conf t
int l 0
ip add 4.4.4.4 255.255.255.255
int e 0/0
ip add 124.1.1.4 255.255.255.0
no sh
int e 0/1
ip add 34.1.1.4 255.255.255.0
no sh
router os 234
router-id 4.4.4.4
int r e 0/1 , l 0
ip os 234 a 0
ip cef
mpls ip
mpls label pro ldp
mpls ldp ro l 0 fo
int e 0/1
mpls ip
ip vrf IOU1
rd 234:16
route-target 234:16
int e 0/0
ip vrf f IOU1
ip add 124.1.1.4 255.255.255.0
IOU3:
conf t
int l 0
ip add 3.3.3.3 255.255.255.255
int e 0/0
ip add 36.1.1.3 255.255.255.0
no sh
int e 0/1
ip add 23.1.1.3 255.255.255.0
no sh
int e 0/2
ip add 34.1.1.3 255.255.255.0
no sh
router os 234
router-id 3.3.3.3
int r e 0/1-2 , l 0
ip os 234 a 0
ip cef
mpls ip
mpls label pro ldp
mpls ldp ro l 0 fo
int r e 0/1-2
mpls ip
ip vrf IOU6
rd 234:16
route-target 234:16
int e 0/0
ip vrf f IOU6
ip add 36.1.1.3 255.255.255.0
ip os 6 a 0
router bgp 234
bgp router-id 3.3.3.3
no bgp def ipv4
nei 2.2.2.2 remot 234
nei 2.2.2.2 up l 0
nei 4.4.4.4 remot 234
nei 4.4.4.4 up l 0
add vpnv4 un
nei 2.2.2.2 ac
nei 2.2.2.2 route-reflector-client
nei 4.4.4.4 ac
nei 4.4.4.4 route-reflector-client
add ipv4 vrf IOU6
red os 6
router os 6 vrf IOU6
red bgp 234 subnets
IOU6:
conf t
int l 0
ip add 6.6.6.6 255.255.255.255
int e 0/0
ip add 36.1.1.6 255.255.255.0
no sh
router os 6
router-id 6.6.6.6
net 0.0.0.0 0.0.0.0 a 0
IOU1:
conf t
int l 0
ip add 1.1.1.1 255.255.255.255
int e 0/0
ip add 124.1.1.1 255.255.255.0
no sh
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
|
|