MPLS STATIC CE-PE

来源:互联网 发布:结构化数据的存储方式 编辑:程序博客网 时间:2024/04/28 06:02
R4(CE)--14.1.1.0/24--(PE)R1--(12.1.1.0/24)--R2(P)--(23.1.1.0)--R3(PE)--(35.1.1.0)--(CE)R5

R4<------STATIC--------->R1<--------------MBGP (AS1)---------->R3<-------STATIC------->R5

hostname r1

ip cef

ip vrf test
rd 1:14
route-target export 1:14
route-target import 1:35

mpls ldp router-id Loopback0

interface Loopback0
ip address 10.1.1.1 255.255.255.0
ip ospf network point-to-point
!
interface Ethernet0/0
ip vrf forwarding test
ip address 14.1.1.1 255.255.255.0
!
interface Serial0/0
ip address 12.1.1.1 255.255.255.0
encapsulation frame-relay
ip ospf network point-to-multipoint
mpls ip
frame-relay map ip 12.1.1.2 102 broadcast
no frame-relay inverse-arp

router ospf 1
log-adjacency-changes
network 10.1.1.0 0.0.0.255 area 0
network 12.1.1.0 0.0.0.255 area 0
!
router bgp 13
no synchronization
neighbor 30.1.1.1 remote-as 13
neighbor 30.1.1.1 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 30.1.1.1 activate
neighbor 30.1.1.1 send-community extended
exit-address-family
!
address-family ipv4 vrf test
redistribute static route-map test
no auto-summary
no synchronization
exit-address-family

ip route vrf test 40.1.1.0 255.255.255.0 14.1.1.4

access-list 1 permit 40.1.1.0 0.0.0.255
!
route-map test permit 10
match ip address 1
===========================================================

hostname r2

ip cef

mpls ldp router-id Loopback0

interface Loopback0
ip address 20.1.1.1 255.255.255.0
!
interface Serial0/0
ip address 12.1.1.2 255.255.255.0
encapsulation frame-relay
ip ospf network point-to-multipoint
mpls ip
no dce-terminal-timing-enable
frame-relay map ip 12.1.1.1 201 broadcast
no frame-relay inverse-arp
!
interface Serial0/1
ip address 23.1.1.2 255.255.255.0
encapsulation frame-relay
ip ospf network point-to-multipoint
mpls ip
no dce-terminal-timing-enable
frame-relay map ip 23.1.1.3 213 broadcast
no frame-relay inverse-arp
!
router ospf 1
log-adjacency-changes
network 12.1.1.0 0.0.0.255 area 0
network 20.1.1.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0

===========================================================

hostname r3

ip cef

ip vrf test
rd 1:35
route-target export 1:35
route-target import 1:14
!
mpls ldp router-id Loopback0
!
interface Loopback0
ip address 30.1.1.1 255.255.255.0
ip ospf network point-to-point
!
interface Serial0/1
ip address 23.1.1.3 255.255.255.0
encapsulation frame-relay
ip ospf network point-to-multipoint
mpls ip
no dce-terminal-timing-enable
frame-relay map ip 23.1.1.2 312 broadcast
no frame-relay inverse-arp

interface Ethernet1/0
ip vrf forwarding test
ip address 35.1.1.3 255.255.255.0

router ospf 1
network 23.1.1.0 0.0.0.255 area 0
network 30.1.1.0 0.0.0.255 area 0
!
router bgp 13
no synchronization
bgp log-neighbor-changes
neighbor 10.1.1.1 remote-as 13
neighbor 10.1.1.1 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 10.1.1.1 activate
neighbor 10.1.1.1 send-community extended
exit-address-family
!
address-family ipv4 vrf test
redistribute static route-map test
no auto-summary
no synchronization
exit-address-family

ip route vrf test 50.1.1.0 255.255.255.0 35.1.1.5

access-list 1 permit 50.1.1.0 0.0.0.255
!
route-map test permit 10
match ip address 1

===========================================================

hostname r4

interface Loopback0
ip address 40.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 14.1.1.4 255.255.255.0

ip route 50.1.1.0 255.255.255.0 14.1.1.1

===========================================================
hostname r5

interface Loopback0
ip address 50.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 35.1.1.5 255.255.255.0

ip route 40.1.1.0 255.255.255.0 35.1.1.3
!
============================================================

r1#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

20.0.0.0/32 is subnetted, 1 subnets
O 20.1.1.1 [110/65] via 12.1.1.2, 02:15:21, Serial0/0
23.0.0.0/32 is subnetted, 2 subnets
O 23.1.1.3 [110/128] via 12.1.1.2, 02:15:21, Serial0/0
O 23.1.1.2 [110/64] via 12.1.1.2, 02:15:21, Serial0/0
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Loopback0
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, Serial0/0
O 12.1.1.2/32 [110/64] via 12.1.1.2, 02:15:23, Serial0/0
30.0.0.0/24 is subnetted, 1 subnets
O 30.1.1.0 [110/129] via 12.1.1.2, 02:15:23, Serial0/0

r1#sh ip vrf detail
VRF test; default RD 1:14; default VPNID <not set>
Interfaces:
Et0/0
Connected addresses are not in global routing table
Export VPN route-target communities
RT:1:14
Import VPN route-target communities
RT:1:35
No import route-map
No export route-map
VRF label distribution protocol: not configured

r1#sh ip bgp vpnv4 vrf test
BGP table version is 6, local router ID is 10.1.1.1
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: 1:14 (default for vrf test)
*> 40.1.1.0/24 14.1.1.4 0 32768 ?
*>i50.1.1.0/24 30.1.1.1 0 100 0 ?

r1#sh mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 Untagged 12.1.1.2/32 0 Se0/0 12.1.1.2
17 Untagged 20.1.1.1/32 0 Se0/0 12.1.1.2
18 Untagged 23.1.1.2/32 0 Se0/0 12.1.1.2
19 18 23.1.1.3/32 0 Se0/0 12.1.1.2
21 Untagged 40.1.1.0/24[V] 2280 Et0/0 14.1.1.4
22 21 30.1.1.0/24 0 Se0/0 12.1.1.2

r1#sh mpls ldp bind
tib entry: 10.1.1.0/24, rev 2
local binding: tag: imp-null
remote binding: tsr: 20.1.1.1:0, tag: 20
tib entry: 12.1.1.0/24, rev 4
local binding: tag: imp-null
remote binding: tsr: 20.1.1.1:0, tag: imp-null
tib entry: 12.1.1.1/32, rev 14
remote binding: tsr: 20.1.1.1:0, tag: 17
tib entry: 12.1.1.2/32, rev 6
local binding: tag: 16
tib entry: 20.1.1.0/24, rev 11
remote binding: tsr: 20.1.1.1:0, tag: imp-null
tib entry: 20.1.1.1/32, rev 8
local binding: tag: 17
tib entry: 23.1.1.0/24, rev 12
remote binding: tsr: 20.1.1.1:0, tag: imp-null
tib entry: 23.1.1.2/32, rev 10
local binding: tag: 18
tib entry: 23.1.1.3/32, rev 16
local binding: tag: 19
remote binding: tsr: 20.1.1.1:0, tag: 18
tib entry: 30.1.1.0/24, rev 20
local binding: tag: 22
remote binding: tsr: 20.1.1.1:0, tag: 21
================================================================

r2#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

20.0.0.0/24 is subnetted, 1 subnets
C 20.1.1.0 is directly connected, Loopback0
23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 23.1.1.3/32 [110/64] via 23.1.1.3, 02:21:00, Serial0/1
C 23.1.1.0/24 is directly connected, Serial0/1
10.0.0.0/24 is subnetted, 1 subnets
O 10.1.1.0 [110/65] via 12.1.1.1, 02:21:00, Serial0/0
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1.0/24 is directly connected, Serial0/0
O 12.1.1.1/32 [110/64] via 12.1.1.1, 02:21:01, Serial0/0
30.0.0.0/24 is subnetted, 1 subnets
O 30.1.1.0 [110/65] via 23.1.1.3, 02:21:01, Serial0/1

r2#sh mpls forward
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
17 Untagged 12.1.1.1/32 2280 Se0/0 12.1.1.1
18 Untagged 23.1.1.3/32 2960 Se0/1 23.1.1.3
20 Pop tag 10.1.1.0/24 16738 Se0/0 12.1.1.1
21 Pop tag 30.1.1.0/24 17353 Se0/1 23.1.1.3


r2#sh mpls ldp bindings
tib entry: 10.1.1.0/24, rev 20
local binding: tag: 20
remote binding: tsr: 10.1.1.1:0, tag: imp-null
remote binding: tsr: 30.1.1.1:0, tag: 22
tib entry: 12.1.1.0/24, rev 4
local binding: tag: imp-null
remote binding: tsr: 10.1.1.1:0, tag: imp-null
tib entry: 12.1.1.1/32, rev 10
local binding: tag: 17
remote binding: tsr: 30.1.1.1:0, tag: 19
tib entry: 12.1.1.2/32, rev 12
remote binding: tsr: 10.1.1.1:0, tag: 16
remote binding: tsr: 30.1.1.1:0, tag: 20
tib entry: 20.1.1.0/24, rev 2
local binding: tag: imp-null
tib entry: 20.1.1.1/32, rev 13
remote binding: tsr: 10.1.1.1:0, tag: 17
remote binding: tsr: 30.1.1.1:0, tag: 16
tib entry: 23.1.1.0/24, rev 6
local binding: tag: imp-null
remote binding: tsr: 30.1.1.1:0, tag: imp-null
tib entry: 23.1.1.2/32, rev 14
remote binding: tsr: 10.1.1.1:0, tag: 18
remote binding: tsr: 30.1.1.1:0, tag: 17
tib entry: 23.1.1.3/32, rev 16
local binding: tag: 18
remote binding: tsr: 10.1.1.1:0, tag: 19
tib entry: 30.1.1.0/24, rev 21
local binding: tag: 21
remote binding: tsr: 30.1.1.1:0, tag: imp-null
remote binding: tsr: 10.1.1.1:0, tag: 22

================================================================
r3#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

20.0.0.0/32 is subnetted, 1 subnets
O 20.1.1.1 [110/65] via 23.1.1.2, 02:23:08, Serial0/1
23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 23.1.1.2/32 [110/64] via 23.1.1.2, 02:23:08, Serial0/1
C 23.1.1.0/24 is directly connected, Serial0/1
10.0.0.0/24 is subnetted, 1 subnets
O 10.1.1.0 [110/129] via 23.1.1.2, 02:23:08, Serial0/1
12.0.0.0/32 is subnetted, 2 subnets
O 12.1.1.1 [110/128] via 23.1.1.2, 02:23:08, Serial0/1
O 12.1.1.2 [110/64] via 23.1.1.2, 02:23:09, Serial0/1
30.0.0.0/24 is subnetted, 1 subnets
C 30.1.1.0 is directly connected, Loopback0
r3#
r3#sh ip vrf test detail
^
% Invalid input detected at '^' marker.

r3#sh ip vrf test ?
| Output modifiers
<cr>

r3#sh ip vrf test
Name Default RD Interfaces
test 1:35 Et1/0
r3#sh ip vrf
Name Default RD Interfaces
test 1:35 Et1/0
r3#sh ip vrf ?
WORD VPN Routing/Forwarding instance name
brief Brief VPN Routing/Forwarding instance information
detail Detailed VPN Routing/Forwarding instance information
id Show VPN Routing/Forwarding VPN-ID information
interfaces Show VPN Routing/Forwarding interface information
| Output modifiers
<cr>

r3#sh ip vrf detail
VRF test; default RD 1:35; default VPNID <not set>
Interfaces:
Et1/0
Connected addresses are not in global routing table
Export VPN route-target communities
RT:1:35
Import VPN route-target communities
RT:1:14
No import route-map
No export route-map
VRF label distribution protocol: not configured

r3#sh ip bgp vpnv4 vrf test
BGP table version is 6, local router ID is 30.1.1.1
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: 1:35 (default for vrf test)
*>i40.1.1.0/24 10.1.1.1 0 100 0 ?
*> 50.1.1.0/24 35.1.1.5 0 32768 ?

r3#sh mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 Untagged 20.1.1.1/32 0 Se0/1 23.1.1.2
17 Untagged 23.1.1.2/32 0 Se0/1 23.1.1.2
19 17 12.1.1.1/32 0 Se0/1 23.1.1.2
20 Untagged 12.1.1.2/32 0 Se0/1 23.1.1.2
21 Untagged 50.1.1.0/24[V] 1710 Et1/0 35.1.1.5
22 20 10.1.1.0/24 0 Se0/1 23.1.1.2
r
r3#sh mpls ldp bind
tib entry: 10.1.1.0/24, rev 20
local binding: tag: 22
remote binding: tsr: 20.1.1.1:0, tag: 20
tib entry: 12.1.1.0/24, rev 16
remote binding: tsr: 20.1.1.1:0, tag: imp-null
tib entry: 12.1.1.1/32, rev 10
local binding: tag: 19
remote binding: tsr: 20.1.1.1:0, tag: 17
tib entry: 12.1.1.2/32, rev 12
local binding: tag: 20
tib entry: 20.1.1.0/24, rev 15
remote binding: tsr: 20.1.1.1:0, tag: imp-null
tib entry: 20.1.1.1/32, rev 2
local binding: tag: 16
tib entry: 23.1.1.0/24, rev 6
local binding: tag: imp-null
remote binding: tsr: 20.1.1.1:0, tag: imp-null
tib entry: 23.1.1.2/32, rev 4
local binding: tag: 17
tib entry: 23.1.1.3/32, rev 17
remote binding: tsr: 20.1.1.1:0, tag: 18
tib entry: 30.1.1.0/24, rev 14
local binding: tag: imp-null
remote binding: tsr: 20.1.1.1:0, tag: 21
========================================================================

r4#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

50.0.0.0/24 is subnetted, 1 subnets
S 50.1.1.0 [1/0] via 14.1.1.1
40.0.0.0/24 is subnetted, 1 subnets
C 40.1.1.0 is directly connected, Loopback0
14.0.0.0/24 is subnetted, 1 subnets
C 14.1.1.0 is directly connected, FastEthernet0/0


==========================================================================
r5#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

50.0.0.0/24 is subnetted, 1 subnets
C 50.1.1.0 is directly connected, Loopback0
35.0.0.0/24 is subnetted, 1 subnets
C 35.1.1.0 is directly connected, FastEthernet0/0
40.0.0.0/24 is subnetted, 1 subnets
S 40.1.1.0 [1/0] via 35.1.1.3


r5#ping 40.1.1.1 source 50.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 40.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 50.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/12/13 ms

===========================================================================
r3#deb mpls packet
MPLS packet debugging is on
r3#
*Jun 2 08:35:00.111: MPLS: Se0/1: recvd: CoS=0, TTL=253, Label(s)=21
*Jun 2 08:35:00.111: MPLS: Et1/0: xmit: (no label)
*Jun 2 08:35:00.123: MPLS: Se0/1: recvd: CoS=0, TTL=253, Label(s)=21
*Jun 2 08:35:00.123: MPLS: Et1/0: xmit: (no label)
*Jun 2 08:35:00.135: MPLS: Se0/1: recvd: CoS=0, TTL=253, Label(s)=21
*Jun 2 08:35:00.135: MPLS: Et1/0: xmit: (no label)
*Jun 2 08:35:00.147: MPLS: Se0/1: recvd: CoS=0, TTL=253, Label(s)=21
*Jun 2 08:35:00.147: MPLS: Et1/0: xmit: (no label)
*Jun 2 08:35:00.163: MPLS: Se0/1: recvd: CoS=0, TTL=253, Label(s)=21
*Jun 2 08:35:00.163: MPLS: Et1/0: xmit: (no label)

=============================================================================
r2#deb mpls packet
MPLS packet debugging is on
r2#
*May 30 10:36:55.423: MPLS: Se0/1: recvd: CoS=0, TTL=254, Label(s)=20/21
*May 30 10:36:55.427: MPLS: Se0/0: xmit: CoS=0, TTL=253, Label(s)=21
*May 30 10:36:55.435: MPLS: Se0/0: recvd: CoS=0, TTL=254, Label(s)=21/21
*May 30 10:36:55.435: MPLS: Se0/1: xmit: CoS=0, TTL=253, Label(s)=21
*May 30 10:36:55.443: MPLS: Se0/1: recvd: CoS=0, TTL=254, Label(s)=20/21
*May 30 10:36:55.443: MPLS: Se0/0: xmit: CoS=0, TTL=253, Label(s)=21
*May 30 10:36:55.451: MPLS: Se0/0: recvd: CoS=0, TTL=254, Label(s)=21/21
*May 30 10:36:55.451: MPLS: Se0/1: xmit: CoS=0, TTL=253, Label(s)=21
*May 30 10:36:55.463: MPLS: Se0/1: recvd: CoS=0, TTL=254, Label(s)=20/21
*May 30 10:36:55.463: MPLS: Se0/0: xmit: CoS=0, TTL=253, Label(s)=21
*May 30 10:36:55.471: MPLS: Se0/0: recvd: CoS=0, TTL=254, Label(s)=21/21
*May 30 10:36:55.471: MPLS: Se0/1: xmit: CoS=0, TTL=253, Label(s)=21
*May 30 10:36:55.479: MPLS: Se0/1: recvd: CoS=0, TTL=254, Label(s)=20/21
*May 30 10:36:55.479: MPLS: Se0/0: xmit: CoS=0, TTL=253, Label(s)=21
*May 30 10:36:55.491: MPLS: Se0/0: recvd: CoS=0, TTL=254, Label(s)=21/21
*May 30 10:36:55.491: MPLS: Se0/1: xmit: CoS=0, TTL=253, Label(s)=21
*May 30 10:36:55.499: MPLS: Se0/1: recvd: CoS=0, TTL=254, Label(s)=20/21
*May 30 10:36:55.499: MPLS: Se0/0: xmit: CoS=0, TTL=253, Label(s)=21
*May 30 10:36:55.507: MPLS: Se0/0: recvd: CoS=0, TTL=254, Label(s)=21/21
================================================================================
r1#deb mpls packet
MPLS packet debugging is on
r1#
*May 22 02:02:40.655: MPLS: Se0/0: recvd: CoS=0, TTL=253, Label(s)=21
*May 22 02:02:40.655: MPLS: Et0/0: xmit: (no label)
*May 22 02:02:40.671: MPLS: Se0/0: recvd: CoS=0, TTL=253, Label(s)=21
*May 22 02:02:40.671: MPLS: Et0/0: xmit: (no label)
*May 22 02:02:40.687: MPLS: Se0/0: recvd: CoS=0, TTL=253, Label(s)=21
*May 22 02:02:40.687: MPLS: Et0/0: xmit: (no label)
*May 22 02:02:40.699: MPLS: Se0/0: recvd: CoS=0, TTL=253, Label(s)=21
*May 22 02:02:40.699: MPLS: Et0/0: xmit: (no label)
*May 22 02:02:40.719: MPLS: Se0/0: recvd: CoS=0, TTL=253, Label(s)=21
*May 22 02:02:40.719: MPLS: Et0/0: xmit: (no label)
================================================================================
r4#ping 50.1.1.1 source 40.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 50.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 40.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/12/16 ms
 
原创粉丝点击