mpls-vpn(CE-PE,rip static)
实验步骤:
Setp1:在mpls backbone中完成IGP(ospf1)
Setp2:运行mpls在backbone中
Setp3:配置vrf在PE上,并且设置vrf的VPN客户RD及RT
Setp4: 为了让PE学习到CE的路由,所以应该在PE与CE之间运行动态路由协议(rip static bgp ospf)
Setp5:建立mp-ibgp关系在R2与R4之间
Setp6:将rip重分布进bgp中通过mp-ibgp传递(将路由从vrf中导出)
Setp7:再将mp-ibgp路由导入到所属于的vrf中,setp6~setp7通过重分布来完成。
R1(config)#int s2/1
R1(config-if)#ip add
R1(config-if)#no shu
R1(config-if)#int lo0
R1(config-if)#ip add
R1(config-if)#do ping
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to
!!!!!
R1(config)#router rip
R1(config-router)#ver 2
R1(config-router)#no au
R1(config-router)#net
R1(config-router)#net
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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
C
R
C
45.0.0.0/24 is subnetted, 1 subnets
R 45.0.0.0 [120/1] vi
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#no router rip
R1(config)#ip route
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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
C
C
S*
R1#ping
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to
!!!!!
R2(config)#int s2/1
R2(config-if)#ip add
R2(config-if)#no shu
R2(config-if)#int s2/2
R2(config-if)#ip add
R2(config-if)#no shu
R2(config-if)#int lo0
R2(config-if)#ip add
Setp1:R3R4一样
R2(config)#router ospf 1
R2(config-router)#router-id
R2(config-router)#net
R2(config-router)#net
Setp2:
R2(config)#ip cef
R2(config)#mpls label range 200 299
R2(config)#mpls label protocol ldp
R2(config)#mpls ldp router-id lo0
R2(config)#int s2/2
R2(config-if)#mpls ip
Setp3:
R2(config)#ip vrf ABC
R2(config-vrf)#rd 100:20
R2(config-vrf)#route-target export 100:20
R2(config-vrf)#int s2/1
R2(config-if)#ip vrf forwarding ABC
% Interface Serial2/1 IP address
R2(config-if)#ip add
R2(config-if)#do ping vrf ABC
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 72/82/120 ms
R2(config-if)#exit
Setp4:
R2(config)#router rip
R2(config-router)#ver 2
R2(config-router)#no au
R2(config-router)#address-family ipv4 vrf ABC
R2(config-router-af)#ver 2
R2(config-router-af)#no au
R2(config-router-af)#net
R2(config-router-af)#do sh ip route vrf ABC
Routing Table: ABC
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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
R
C
Setp5:
R2(config)#router bgp 234
R2(config-router)#bgp router-id
R2(config-router)#no au
R2(config-router)#no syn
R2(config-router)#nei
R2(config-router)#nei
R2(config-router)#no bgp default ipv4-unicast
R2(config-router)#address-family vpnv4
R2(config-router-af)#nei
Setp6:
R2(config)#router bgp 234
R2(config-router)#address-family ipv4 vrf ABC
R2(config-router-af)#redistribute rip
Setp7:
R2(config)#ip vrf ABC
R2(config-vrf)#route-target import 100:40
R2(config)#router rip
R2(config-router)#ver 2
R2(config-router)#address-family ipv4 vrf ABC
R2(config-router-af)#redistribute bgp 234 metric 1
PE与CE之间跑静态路由static
R2(config)#no router rip
R2(config)#ip route vrf ABC
R2(config)#router bgp 234
R2(config-router)#address-family ipv4 vrf ABC
R2(config-router-af)#no redistribute rip
R2(config-router-af)#redistribute static
R2(config-router-af)#redistribute connected
R3(config)#int s2/1
R3(config-if)#ip add
R3(config-if)#no shu
R3(config-if)#int s2/2
R3(config-if)#ip add 34.0.0.3 255.255.255.0
R3(config-if)#no shu
R3(config-if)#int lo0
R3(config-if)#ip add
R3(config-if)#do ping 34.0.0.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 34.0.0.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 96/114/144 ms
R3(config)#router ospf 1
R3(config-router)#router-id
R3(config-router)#net
R3(config-router)#net 34.0.0.0
R3(config-router)#net
R3(config-router)#do sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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
34.0.0.0/24 is subnetted, 1 subnets
C 34.0.0.0 is directly connected, Serial2/2
O
C
O
C
R3(config)#ip cef
R3(config)#mpls label range 300 399
R3(config)#mpls label protocol ldp
R3(config)#mpls ldp router-id lo0
R3(config)#int s2/1
R3(config-if)#mpls ip
R3(config-if)#int s2/2
R3(config-if)#mpls ip
R3(config-if)#do sh mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
300 Pop tag
301 Pop tag
R4(config)#int s2/1
R4(config-if)#ip add 34.0.0.4 255.255.255.0
R4(config-if)#no shu
R4(config-if)#int s2/2
R4(config-if)#ip add 45.0.0.4 255.255.255.0
R4(config-if)#no shu
R4(config-if)#int lo0
R4(config-if)#ip add
R4(config-if)#do ping 45.0.0.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 45.0.0.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 72/92/120 ms
Setp1:
R4(config)#router ospf 1
R4(config-router)#router-id
R4(config-router)#net 34.0.0.0
R4(config-router)#net
R4(config-router)#net
R4#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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
34.0.0.0/24 is subnetted, 1 subnets
C 34.0.0.0 is directly connected, Serial2/1
O
O
C
O
45.0.0.0/24 is subnetted, 1 subnets
C 45.0.0.0 is directly connected, Serial2/2
Setp2:
R4(config)#ip cef
R4(config)#mpls label range 400 499
R4(config)#mpls label protocol ldp
R4(config)#mpls ldp router-id lo0
R4(config)#int s2/1
R4(config-if)#mpls ip
R4(config-if)#do sh mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
400 300
401 Pop tag
402 Pop tag
Setp3:
R4(config)#ip vrf ABC
R4(config-vrf)#rd 100:40
R4(config-vrf)#route-target export 100:40
R4(config-vrf)#int s2/2
R4(config-if)#ip vrf forwarding ABC
% Interface Serial2/2 IP address 45.0.0.4 removed due to enabling VRF ABC
R4(config-if)#ip add 45.0.0.4 255.255.255.0
R4(config-if)#do ping vrf ABC 45.0.0.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 45.0.0.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 72/82/120 ms
R4(config-if)#exit
Setp4:
R4(config)#router rip
R4(config-router)#ver 2
R4(config-router)#no au
R4(config-router)#address-family ipv4 vrf ABC
R4(config-router-af)#ver 2
R4(config-router-af)#no au
R4(config-router-af)#net 45.0.0.0
R4(config-router-af)#do sh ip route vrf ABC
Routing Table: ABC
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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
R
45.0.0.0/24 is subnetted, 1 subnets
C 45.0.0.0 is directly connected, Serial2/2
Setp5:
R4(config)#router bgp 234
R4(config-router)#bgp router-id
R4(config-router)#no au
R4(config-router)#no syn
R4(config-router)#nei
R4(config-router)#nei
R4(config-router)#no bgp default ipv4-unicast
R4(config-router)#address-family vpnv4
R4(config-router-af)#nei
Setp6:
R4(config)#router bgp 234
R4(config-router)#address-family ipv4 vrf ABC
R4(config-router-af)#redistribute rip
Setp7:
R4(config)#ip vrf ABC
R4(config-vrf)#route-target import 100:20
R4(config)#router rip
R4(config-router)#ver 2
R4(config-router)#address-family ipv4 vrf ABC
R4(config-router-af)#redistribute bgp 234 metric 1
R4(config)#router bgp 234
R4(config-router)#no bgp default route-target filter
R4#sh ip bgp vpn all
BGP table version is 9, local router ID is
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 100:20
*>i
*>i
Route Distinguisher: 100:40 (default for vrf ABC)
*>i
*>
*>i
*> 45.0.0.0/24
R4#sh ip cef vrf ABC
0 packets, 0 bytes
tag information set
local tag: VPN-route-head
fast tag rewrite with Se2/1, point2point, tags imposed: {300 203}
vi
next hop 34.0.0.3, Serial2/1 vi
valid cached adjacency
tag rewrite with Se2/1, point2point, tags imposed: {300 203}
PE与CE之间跑静态路由static
R4(config)#no router rip
R4(config)#ip route vrf ABC
R4(config)#router bgp 234
R4(config-router)#address-family ipv4 vrf ABC
R4(config-router-af)#no redistribute rip
R4(config-router-af)#redistribute static
R4(config-router-af)#redistribute connected
R4(config-router)#do sh ip route vrf ABC
Routing Table: ABC
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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
B
S
B
45.0.0.0/24 is subnetted, 1 subnets
C 45.0.0.0 is directly connected, Serial2/2
R5(config)#int s2/2
R5(config-if)#ip add 45.0.0.5 255.255.255.0
R5(config-if)#no shu
R5(config-if)#int lo0
R5(config-if)#ip add
R5(config-if)#exit
R5(config)#router rip
R5(config-router)#ver 2
R5(config-router)#no au
R5(config-router)#net 45.0.0.0
R5(config-router)#net
R5(config-router)#do sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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
R
C
R
45.0.0.0/24 is subnetted, 1 subnets
C 45.0.0.0 is directly connected, Serial2/2
R5(config-router)#exit
R5(config)#no router rip
R5(config)#
R5(config)#
R5(config)#ip route
R5(config)#^Z
R5#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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
C
45.0.0.0/24 is subnetted, 1 subnets
C 45.0.0.0 is directly connected, Serial2/2
S*
R5#ping
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to
!!!!! 本文出自 51CTO.COM技术博客 |


车开往海边
博客统计信息
热门文章
最新评论
友情链接