![基于Cisco技术的MPLS原理以及应用实现[二]_休闲](https://s2.51cto.com/attachment/201009/201009131284436458788.jpg?x-oss-process=image/resize,m_fixed,w_1184)
![基于Cisco技术的MPLS原理以及应用实现[二]_mpls vpnv4 bgp ldp_02](https://s2.51cto.com/attachment/201009/201009131284436489988.jpg?x-oss-process=image/resize,m_fixed,w_1184)
Building configuration...
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
!
!
interface Loopback0
ip address 10.10.10.10 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Ethernet1/0
ip address 172.16.1.1 255.255.0.0
duplex half
!
interface Ethernet1/1
no ip address
shutdown
duplex half
!
interface Ethernet1/2
no ip address
shutdown
duplex half
!
interface Ethernet1/3
no ip address
shutdown
duplex half
!
router ospf 1
log-adjacency-changes
network 10.10.10.10 0.0.0.0 area 0
network 172.16.1.1 0.0.0.0 area 0
!
ip classless
no ip http server
no ip http secure-server
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
end
r1#
r2#sh run
Building configuration...
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip vrf 12
rd 12:12
route-target export 12:12
route-target import 56:56
!
ip cef
mpls label range 200 299
mpls label protocol ldp
tag-switching tdp router-id Loopback1
!
!
interface Loopback0
ip vrf forwarding 12
ip address 20.20.20.20 255.255.255.255
!
interface Loopback1
ip address 22.22.22.22 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Ethernet1/0
ip vrf forwarding 12
ip address 172.16.2.2 255.255.0.0
duplex half
!
interface Ethernet1/1
ip address 10.2.2.2 255.255.255.0
duplex half
tag-switching ip
!
interface Ethernet1/2
no ip address
shutdown
duplex half
!
interface Ethernet1/3
no ip address
shutdown
duplex half
!
router ospf 2 vrf 12
log-adjacency-changes
redistribute bgp 200 subnets
network 20.20.20.20 0.0.0.0 area 0
network 172.16.2.2 0.0.0.0 area 0
!
router ospf 22
log-adjacency-changes
network 10.2.2.2 0.0.0.0 area 0
network 22.22.22.22 0.0.0.0 area 0
!
router bgp 200
bgp router-id 22.22.22.22
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 50.50.50.50 remote-as 200
neighbor 50.50.50.50 update-source Loopback1
!
address-family vpnv4
neighbor 50.50.50.50 activate
neighbor 50.50.50.50 send-community extended
exit-address-family
!
address-family ipv4 vrf 12
redistribute ospf 2 match internal external 1 external 2
no auto-summary
no synchronization
exit-address-family
!
ip classless
no ip http server
no ip http secure-server
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
end
r3#sh run
Building configuration...
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
mpls label range 300 399
mpls label protocol ldp
tag-switching tdp router-id Loopback0
!
!
interface Loopback0
ip address 30.30.30.30 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Ethernet1/0
no ip address
shutdown
duplex half
!
interface Ethernet1/1
ip address 10.2.2.3 255.255.255.0
duplex half
tag-switching ip
!
interface Ethernet1/2
ip address 10.3.3.3 255.255.255.0
duplex half
tag-switching ip
!
interface Ethernet1/3
no ip address
shutdown
duplex half
!
router ospf 3
log-adjacency-changes
network 10.2.2.3 0.0.0.0 area 0
network 10.3.3.3 0.0.0.0 area 0
network 30.30.30.30 0.0.0.0 area 0
!
ip classless
no ip http server
no ip http secure-server
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
end
r3#
r4#sh run
Building configuration...
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
mpls label range 400 499
mpls label protocol ldp
tag-switching tdp router-id Loopback0
!
!
interface Loopback0
ip address 40.40.40.40 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Ethernet1/0
no ip address
shutdown
duplex half
!
interface Ethernet1/1
no ip address
shutdown
duplex half
!
interface Ethernet1/2
ip address 10.3.3.4 255.255.255.0
duplex half
tag-switching ip
!
interface Ethernet1/3
ip address 10.4.4.4 255.255.255.0
duplex half
tag-switching ip
!
router ospf 4
log-adjacency-changes
network 10.3.3.4 0.0.0.0 area 0
network 10.4.4.4 0.0.0.0 area 0
network 40.40.40.40 0.0.0.0 area 0
!
ip classless
no ip http server
no ip http secure-server
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
end
r5#sh run
Building configuration...
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r5
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip vrf 56
rd 56:56
route-target export 56:56
route-target import 12:12
!
ip cef
mpls label range 500 599
mpls label protocol ldp
tag-switching tdp router-id Loopback0
!
!
interface Loopback0
ip address 50.50.50.50 255.255.255.255
!
interface Loopback1
ip vrf forwarding 56
ip address 55.55.55.55 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Ethernet1/0
ip vrf forwarding 56
ip address 172.17.5.5 255.255.0.0
duplex half
!
interface Ethernet1/1
no ip address
shutdown
duplex half
!
interface Ethernet1/2
no ip address
shutdown
duplex half
!
interface Ethernet1/3
ip address 10.4.4.5 255.255.255.0
duplex half
tag-switching ip
!
router ospf 55
log-adjacency-changes
network 10.4.4.5 0.0.0.0 area 0
network 50.50.50.50 0.0.0.0 area 0
!
router ospf 5 vrf 56
log-adjacency-changes
redistribute bgp 200 subnets
network 55.55.55.55 0.0.0.0 area 0
network 172.17.5.5 0.0.0.0 area 0
!
router bgp 200
bgp router-id 50.50.50.50
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 22.22.22.22 remote-as 200
neighbor 22.22.22.22 update-source Loopback0
!
address-family vpnv4
neighbor 22.22.22.22 activate
neighbor 22.22.22.22 send-community extended
exit-address-family
!
address-family ipv4 vrf 56
redistribute ospf 5 match internal external 1 external 2
no auto-summary
no synchronization
exit-address-family
!
ip classless
no ip http server
no ip http secure-server
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
end
r6#sh run
Building configuration...
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r6
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip cef
!
interface Loopback0
ip address 6.6.6.6 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Ethernet1/0
ip address 172.17.6.6 255.255.0.0
duplex half
!
interface Ethernet1/1
no ip address
shutdown
duplex half
!
interface Ethernet1/2
no ip address
shutdown
duplex half
!
interface Ethernet1/3
no ip address
shutdown
duplex half
!
router ospf 6
log-adjacency-changes
network 6.6.6.6 0.0.0.0 area 0
network 172.17.6.6 0.0.0.0 area 0
!
ip classless
no ip http server
no ip http secure-server
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
!
end
rd 12:12
route-target export 12:12
route-target import 56:56
ip vrf forwarding 12
ip address 20.20.20.20 255.255.255.255
!
interface Ethernet1/0
ip vrf forwarding 12
ip address 172.16.2.2 255.255.0.0
duplex half
BGP routing table entry for 12:12:10.10.10.10/32, version 8
Paths: (1 available, best #1, table 12)
Advertised to non peer-group peers:
50.50.50.50
Local
172.16.1.1 from 0.0.0.0 (22.22.22.22)
Origin incomplete, metric 11, localpref 100, weight 32768, valid, sourced, best
Extended Community: RT:12:12 OSPF DOMAIN ID:0x0005:0x000000020200 OSPF RT:0.0.0.0:2:0 OSPF ROUTER ID:20.20.20.20:512,
mpls labels in/out 205/nolabel
r2#
BGP table version is 13, local router ID is 22.22.22.22
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Route Distinguisher: 12:12 (default for vrf 12)
*>i6.6.6.6/32 50.50.50.50 11 100 0 ?
*> 10.10.10.10/32 172.16.1.1 11 32768 ?
*> 20.20.20.20/32 0.0.0.0 0 32768 ?
*>i55.55.55.55/32 50.50.50.50 0 100 0 ?
*> 172.16.0.0 0.0.0.0 0 32768 ?
*>i172.17.0.0 50.50.50.50 0 100 0 ?
Route Distinguisher: 56:56
*>i6.6.6.6/32 50.50.50.50 11 100 0 ?
*>i55.55.55.55/32 50.50.50.50 0 100 0 ?
*>i172.17.0.0 50.50.50.50 0 100 0 ?
tib entry: 10.2.2.0/24, rev 2
local binding: tag: imp-null
remote binding: tsr: 30.30.30.30:0, tag: imp-null
tib entry: 10.3.3.0/24, rev 6
local binding: tag: 200
remote binding: tsr: 30.30.30.30:0, tag: imp-null
tib entry: 10.4.4.0/24, rev 8
local binding: tag: 201
remote binding: tsr: 30.30.30.30:0, tag: 300
tib entry: 22.22.22.22/32, rev 4
local binding: tag: imp-null
remote binding: tsr: 30.30.30.30:0, tag: 303
tib entry: 30.30.30.30/32, rev 10
local binding: tag: 202
remote binding: tsr: 30.30.30.30:0, tag: imp-null
tib entry: 40.40.40.40/32, rev 12
local binding: tag: 203
remote binding: tsr: 30.30.30.30:0, tag: 301
tib entry: 50.50.50.50/32, rev 14
local binding: tag: 204
remote binding: tsr: 30.30.30.30:0, tag: 302
r2#
Network Next Hop In label/Out label
Route Distinguisher: 12:12 (12)
6.6.6.6/32 50.50.50.50 nolabel/505
10.10.10.10/32 172.16.1.1 205/nolabel
20.20.20.20/32 0.0.0.0 206/aggregate(12)
55.55.55.55/32 50.50.50.50 nolabel/506
172.16.0.0 0.0.0.0 207/aggregate(12)
172.17.0.0 50.50.50.50 nolabel/507
IP CEF with switching (Table Version 21), flags=0x0
15 routes, 0 reresolve, 0 unresolved (0 old, 0 new), peak 0
6 instant recursive resolutions, 0 used background process
31 leaves, 51 nodes, 55336 bytes, 52 inserts, 21 invalidations
0 load sharing elements, 0 bytes, 0 references
universal per-destination load sharing algorithm, id 0FDE3D1C
3(0) CEF resets, 0 revisions of existing leaves
Resolution Timer: Exponential (currently 1s, peak 1s)
0 in-place/0 aborted modifications
refcounts: 13577 leaf, 13568 node
0.0.0.0/0, version 0, epoch 0, attached, default route handler
0 packets, 0 bytes
via 0.0.0.0, 0 dependencies
valid no route adjacency
0.0.0.0/32, version 1, epoch 0, receive
6.6.6.6/32, version 18, epoch 0, cached adjacency 10.2.2.3
0 packets, 0 bytes
tag information set
local tag: ×××-route-head
fast tag rewrite with Et1/1, 10.2.2.3, tags imposed: {302 505}
via 50.50.50.50, 0 dependencies, recursive
next hop 10.2.2.3, Ethernet1/1 via 50.50.50.50/32
valid cached adjacency
tag rewrite with Et1/1, 10.2.2.3, tags imposed: {302 505}
10.10.10.10/32, version 14, epoch 0, cached adjacency 172.16.1.1
0 packets, 0 bytes
tag information set
local tag: 205
via 172.16.1.1, Ethernet1/0, 0 dependencies
next hop 172.16.1.1, Ethernet1/0
valid cached adjacency
tag rewrite with Et1/0, 172.16.1.1, tags imposed: {}
20.20.20.20/32, version 10, epoch 0, connected, receive
tag information set
local tag: 206
55.55.55.55/32, version 19, epoch 0, cached adjacency 10.2.2.3
0 packets, 0 bytes
tag information set
local tag: ×××-route-head
fast tag rewrite with Et1/1, 10.2.2.3, tags imposed: {302 506}
via 50.50.50.50, 0 dependencies, recursive
next hop 10.2.2.3, Ethernet1/1 via 50.50.50.50/32
valid cached adjacency
tag rewrite with Et1/1, 10.2.2.3, tags imposed: {302 506}
172.16.0.0/16, version 5, epoch 0, attached, connected
0 packets, 0 bytes
tag information set
local tag: 207
via Ethernet1/0, 0 dependencies
valid glean adjacency
tag rewrite with , , tags imposed: {}
172.16.0.0/32, version 8, epoch 0, receive
172.16.1.1/32, version 13, epoch 0, connected, cached adjacency 172.16.1.1
0 packets, 0 bytes
via 172.16.1.1, Ethernet1/0, 0 dependencies
next hop 172.16.1.1, Ethernet1/0
valid cached adjacency
172.16.2.2/32, version 7, epoch 0, receive
172.16.255.255/32, version 9, epoch 0, receive
172.17.0.0/16, version 20, epoch 0, cached adjacency 10.2.2.3
0 packets, 0 bytes
tag information set
local tag: ×××-route-head
fast tag rewrite with Et1/1, 10.2.2.3, tags imposed: {302 507}
via 50.50.50.50, 0 dependencies, recursive
next hop 10.2.2.3, Ethernet1/1 via 50.50.50.50/32
valid cached adjacency
tag rewrite with Et1/1, 10.2.2.3, tags imposed: {302 507}
224.0.0.0/4, version 12, epoch 0
0 packets, 0 bytes, Precedence routine (0)
via 0.0.0.0, 0 dependencies
next hop 0.0.0.0
valid drop adjacency
224.0.0.0/24, version 3, epoch 0, receive
255.255.255.255/32, version 2, epoch 0, receive
r2#