MP-BGP_第1张图片
R1#show ip inter b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 172.16.2.2 YES manual up up
Ethernet0/1 unassigned YES NVRAM administratively down down
Ethernet0/2 unassigned YES NVRAM administratively down down
Ethernet0/3 unassigned YES NVRAM administratively down down
Loopback0 172.16.200.1 YES manual up up
R1#show run | s bgp
router bgp 3
bgp log-neighbor-changes
network 172.16.200.1 mask 255.255.255.255
neighbor 172.16.2.1 remote-as 1
R8#show ip inter b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES NVRAM administratively down down
Ethernet0/1 172.16.1.2 YES manual up up
Ethernet0/2 unassigned YES NVRAM administratively down down
Ethernet0/3 unassigned YES NVRAM administratively down down
Loopback0 172.16.100.1 YES manual up up
R8#show run | s bgp
router bgp 2
bgp log-neighbor-changes
network 172.16.100.1 mask 255.255.255.255
neighbor 172.16.1.1 remote-as 1
PE
R2#show run | s bgp
redistribute bgp 1 metric 10000 100 1 255 1500
router bgp 1
bgp router-id 1.1.1.1
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 10.4.4.4 remote-as 1
neighbor 10.4.4.4 update-source Loopback0
!
address-family ipv4
neighbor 10.4.4.4 activate
neighbor 10.4.4.4 next-hop-self
exit-address-family
!
address-family ***v4
neighbor 10.4.4.4 activate
neighbor 10.4.4.4 send-community extended
exit-address-family
!
address-family ipv4 vrf A-2
redistribute eigrp 1
exit-address-family
!
address-family ipv4 vrf B-2
neighbor 172.16.2.2 remote-as 3
neighbor 172.16.2.2 activate
exit-address-family
R2#show run
Building configuration...

Current configuration : 2200 bytes
!
! Last configuration change at 19:59:34 CST Sun Apr 15 2018
version 15.2
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
!
clock timezone CST 8 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
ip auth-proxy max-login-attempts 5
ip admission max-login-attempts 5
!
!
!
ip vrf A-2
rd 1:1
route-target export 10:2
route-target import 10:1
!
ip vrf B-2
rd 2:2
route-target export 20:2
route-target import 20:1
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 200 299
mpls label protocol ldp
!
!
!
!
!
!
!
!
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 10.2.2.2 255.255.255.255
!
interface Ethernet0/0
ip vrf forwarding B-2
ip address 172.16.2.1 255.255.255.0
!
interface Ethernet0/1
ip address 10.1.23.2 255.255.255.0
mpls ip
!
interface Ethernet0/2
ip vrf forwarding A-2
ip address 172.16.2.1 255.255.255.0
!
interface Ethernet0/3
no ip address
shutdown
!
!
router eigrp 100
!
address-family ipv4 vrf A-2 autonomous-system 1
redistribute bgp 1 metric 10000 100 1 255 1500
network 172.16.2.0 0.0.0.255
exit-address-family
!
router ospf 1
router-id 2.2.2.2
network 10.0.0.0 0.255.255.255 area 0
!
router bgp 1
bgp router-id 1.1.1.1
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 10.4.4.4 remote-as 1
neighbor 10.4.4.4 update-source Loopback0
!
address-family ipv4
neighbor 10.4.4.4 activate
neighbor 10.4.4.4 next-hop-self
exit-address-family
!
address-family ***v4
neighbor 10.4.4.4 activate
neighbor 10.4.4.4 send-community extended
exit-address-family
!
address-family ipv4 vrf A-2
redistribute eigrp 1
exit-address-family
!
address-family ipv4 vrf B-2
neighbor 172.16.2.2 remote-as 3
neighbor 172.16.2.2 activate
exit-address-family
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
mpls ldp router-id Loopback0 force
!
control-plane
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
transport input all
!
!
end

P
R3#show run
Building configuration...

Current configuration : 1246 bytes
!
! Last configuration change at 19:36:16 CST Sun Apr 15 2018
version 15.2
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
!
clock timezone CST 8 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
ip auth-proxy max-login-attempts 5
ip admission max-login-attempts 5
!
!
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 300 399
mpls label protocol ldp
!
!
!
!
!
!
!
!
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 10.3.3.3 255.255.255.255
!
interface Ethernet0/0
ip address 10.1.23.3 255.255.255.0
!
interface Ethernet0/1
ip address 10.1.34.3 255.255.255.0
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
router ospf 1
mpls ldp autoconfig
router-id 3.3.3.3
network 0.0.0.0 255.255.255.255 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
mpls ldp router-id Loopback0 force
!
control-plane
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
transport input all
!
!
end
PE
[OK]
R4#show run
Building configuration...

Current configuration : 2200 bytes
!
! Last configuration change at 19:59:43 CST Sun Apr 15 2018
version 15.2
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
!
clock timezone CST 8 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
ip auth-proxy max-login-attempts 5
ip admission max-login-attempts 5
!
!
!
ip vrf A-1
rd 1:1
route-target export 10:1
route-target import 10:2
!
ip vrf B-1
rd 2:2
route-target export 20:1
route-target import 20:2
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
mpls label range 400 499
mpls label protocol ldp
!
!
!
!
!
!
!
!
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 10.4.4.4 255.255.255.255
!
interface Ethernet0/0
ip address 10.1.34.4 255.255.255.0
mpls ip
!
interface Ethernet0/1
ip vrf forwarding A-1
ip address 172.16.1.1 255.255.255.0
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
ip vrf forwarding B-1
ip address 172.16.1.1 255.255.255.0
!
!
router eigrp 100
!
address-family ipv4 vrf A-1 autonomous-system 1
redistribute bgp 1 metric 10000 100 255 1 1500
network 172.16.1.0 0.0.0.255
exit-address-family
!
router ospf 1
router-id 4.4.4.4
network 10.0.0.0 0.255.255.255 area 0
!
router bgp 1
bgp router-id 4.4.4.4
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 10.2.2.2 remote-as 1
neighbor 10.2.2.2 update-source Loopback0
!
address-family ipv4
neighbor 10.2.2.2 activate
neighbor 10.2.2.2 next-hop-self
exit-address-family
!
address-family ***v4
neighbor 10.2.2.2 activate
neighbor 10.2.2.2 send-community extended
exit-address-family
!
address-family ipv4 vrf A-1
redistribute eigrp 1
exit-address-family
!
address-family ipv4 vrf B-1
neighbor 172.16.1.2 remote-as 2
neighbor 172.16.1.2 activate
exit-address-family
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
mpls ldp router-id Loopback0 force
!
control-plane
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
transport input all
!
!
end
CE
R5#show run | s eigrp
router eigrp 1
network 0.0.0.0
R5#show ip inter b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 172.16.1.2 YES manual up up
Ethernet0/1 unassigned YES NVRAM administratively down down
Ethernet0/2 unassigned YES NVRAM administratively down down
Ethernet0/3 unassigned YES NVRAM administratively down down
Loopback0 172.16.100.1 YES manual up up
R5#
CE
R6#show run | s eigrp
router eigrp 1
network 0.0.0.0
R6#show ip inter b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 172.16.2.2 YES manual up up
Ethernet0/1 unassigned YES NVRAM administratively down down
Ethernet0/2 unassigned YES NVRAM administratively down down
Ethernet0/3 unassigned YES NVRAM administratively down down
Loopback0 172.16.200.1 YES manual up up

R2#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
200 No Label 172.16.2.0/24[V] 0 aggregate/A-2
201 No Label 172.16.200.1/32[V] \
570 Et0/2 172.16.2.2
202 Pop Label 10.1.34.0/24 0 Et0/1 10.1.23.3
203 Pop Label 10.3.3.3/32 0 Et0/1 10.1.23.3
204 301 10.4.4.4/32 0 Et0/1 10.1.23.3
205 No Label 172.16.200.1/32[V] \
1140 Et0/0 172.16.2.2
R2#
R3#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
300 Pop Label 10.2.2.2/32 7763 Et0/0 10.1.23.2
301 Pop Label 10.4.4.4/32 7354 Et0/1 10.1.34.4
R3#
R4#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
400 No Label 172.16.1.0/24[V] 570 aggregate/A-1
401 No Label 172.16.100.1/32[V] \
0 Et0/1 172.16.1.2
402 Pop Label 10.1.23.0/24 0 Et0/0 10.1.34.3
403 300 10.2.2.2/32 0 Et0/0 10.1.34.3
404 Pop Label 10.3.3.3/32 0 Et0/0 10.1.34.3
405 No Label 172.16.100.1/32[V] \
570 Et0/3 172.16.1.2
R8#ping 172.16.200.1 source loopback0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.200.1, timeout is 2 seconds:
Packet sent with a source address of 172.16.100.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/2 ms
R8#
R8#ping 172.16.200.1 (因为仅仅宣告了环回,所以只能环回之间进行通信)
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.200.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R5#ping 172.16.200.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.200.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/8 ms
R5#
R5#ping 172.16.200.1 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.200.1, timeout is 2 seconds:
Packet sent with a source address of 172.16.100.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/3 ms
R5#