跨域××× 组网-OptionA

多域mpls vpn 类型A_MPLS
组网需求
R1 和R6 属于同一个×××。R1 通过AS100 的R2 接入,R6 通过AS200 的R5 接入。采用OptionA方式实现跨域的BGP/MPLS ×××.
r1#show  run
hostname r1
!
no ip domain lookup
!
ip cef
!
interface Loopback0
 ip address 10.1.1.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 1.1.1.1 255.255.255.0
 duplex half
!
router bgp 1000
 no synchronization
 bgp log-neighbor-changes
 redistribute connected
 neighbor 1.1.1.2 remote-as 100
 no auto-summary
!
ip classless
!
line con 0
 exec-timeout 0 0
 logging synchronous
!
End
r2#show  run
hostname r2
!
no ip domain lookup
!
ip vrf vpn
 rd 100:1
 route-target export 100:1
 route-target import 100:1
!
ip cef
!
!
interface Loopback0
 ip address 20.1.1.1 255.255.255.255
!         
interface FastEthernet0/0
 ip vrf forwarding vpn
 ip address 1.1.1.2 255.255.255.0
 duplex half
!
interface FastEthernet1/0
 ip address 2.1.1.1 255.255.255.0
 duplex half
 tag-switching ip
!
router ospf 1
 log-adjacency-changes
 network 2.1.1.0 0.0.0.255 area 0
 network 20.1.1.1 0.0.0.0 area 0
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 30.1.1.1 remote-as 100
 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 next-hop-self
 neighbor 30.1.1.1 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf vpn
 redistribute connected
 neighbor 1.1.1.1 remote-as 1000
 neighbor 1.1.1.1 activate
 no auto-summary
 no synchronization
 exit-address-family
!
ip classless
!
line con 0
 exec-timeout 0 0
 logging synchronous
!
End
r3#show run
hostname r3
!
no ip domain lookup
!
ip vrf vpn
 rd 100:2
 route-target export 100:1
 route-target import 100:1
!
ip cef
!
interface Loopback0
 ip address 30.1.1.1 255.255.255.255
!         
interface FastEthernet0/0
 ip vrf forwarding vpn
 ip address 3.1.1.1 255.255.255.0
 duplex half
!
interface FastEthernet1/0
 ip address 2.1.1.2 255.255.255.0
 duplex half
 tag-switching ip
!
router ospf 1
 log-adjacency-changes
 network 2.1.1.2 0.0.0.0 area 0
 network 30.1.1.1 0.0.0.0 area 0
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 20.1.1.1 remote-as 100
 neighbor 20.1.1.1 update-source Loopback0
 no auto-summary
 !
 address-family vpnv4
 neighbor 20.1.1.1 activate
 neighbor 20.1.1.1 next-hop-self
 neighbor 20.1.1.1 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf vpn
 neighbor 3.1.1.2 remote-as 200
 neighbor 3.1.1.2 activate
 no auto-summary
 no synchronization
 exit-address-family
!
ip classless
!
line con 0
 exec-timeout 0 0
 logging synchronous
!
End
r4#show  run
hostname r4
!
no ip domain lookup
!
ip vrf vpn
 rd 200:2
 route-target export 100:1
 route-target import 100:1
!
ip cef
!
interface Loopback0
 ip address 40.1.1.1 255.255.255.255
!         
interface FastEthernet0/0
 ip vrf forwarding vpn
 ip address 3.1.1.2 255.255.255.0
 duplex half
!
interface FastEthernet1/0
 ip address 4.1.1.1 255.255.255.0
 duplex half
 tag-switching ip
!
router ospf 1
 log-adjacency-changes
 network 4.1.1.0 0.0.0.255 area 0
 network 40.1.1.1 0.0.0.0 area 0
!
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 50.1.1.1 remote-as 200
 neighbor 50.1.1.1 update-source Loopback0
 no auto-summary
 !
 address-family vpnv4
 neighbor 50.1.1.1 activate
 neighbor 50.1.1.1 next-hop-self
 neighbor 50.1.1.1 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf vpn
 neighbor 3.1.1.1 remote-as 100
 neighbor 3.1.1.1 activate
 no auto-summary
 no synchronization
 exit-address-family
!
ip classless
!
line con 0
 exec-timeout 0 0
 logging synchronous
!
End
r5#show run
!
!
hostname r5
!
no ip domain lookup
!
ip vrf vpn
 rd 200:1
 route-target export 100:1
 route-target import 100:1
!
ip cef
!
interface Loopback0
 ip address 50.1.1.1 255.255.255.255
!         
interface FastEthernet0/0
 ip vrf forwarding vpn
 ip address 5.1.1.1 255.255.255.0
 duplex half
!
interface FastEthernet1/0
 ip address 4.1.1.2 255.255.255.0
 duplex half
 tag-switching ip
!
router ospf 1
 log-adjacency-changes
 network 4.1.1.0 0.0.0.255 area 0
 network 50.1.1.1 0.0.0.0 area 0
!
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 40.1.1.1 remote-as 200
 neighbor 40.1.1.1 update-source Loopback0
 no auto-summary
 !
 address-family vpnv4
 neighbor 40.1.1.1 activate
 neighbor 40.1.1.1 next-hop-self
 neighbor 40.1.1.1 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf vpn
 redistribute connected
 neighbor 5.1.1.2 remote-as 2000
 neighbor 5.1.1.2 activate
 no auto-summary
 no synchronization
 exit-address-family
!
ip classless
!
line con 0
 exec-timeout 0 0
 logging synchronous
!
End
r6#show run
!
hostname r6
!
!
no ip domain lookup
!
ip cef
!
interface Loopback0
 ip address 60.1.1.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 5.1.1.2 255.255.255.0
 duplex half
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex half
!
router bgp 2000
 no synchronization
 bgp log-neighbor-changes
 redistribute connected
 neighbor 5.1.1.1 remote-as 200
 no auto-summary
!
ip classless
!
line con 0
 exec-timeout 0 0
 logging synchronous
!
end
r1#    show    ip  route
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, FastEthernet0/0
     5.0.0.0/24 is subnetted, 1 subnets
B       5.1.1.0 [20/0] via 1.1.1.2, 00:12:08
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Loopback0
     60.0.0.0/24 is subnetted, 1 subnets
B       60.1.1.0 [20/0] via 1.1.1.2, 00:12:08
r2#show  ip  route   vrf    vpn
Routing Table: vpn
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, FastEthernet0/0
     5.0.0.0/24 is subnetted, 1 subnets
B       5.1.1.0 [200/0] via 30.1.1.1, 00:09:55
     10.0.0.0/24 is subnetted, 1 subnets
B       10.1.1.0 [20/0] via 1.1.1.1, 00:39:04
     60.0.0.0/24 is subnetted, 1 subnets
B       60.1.1.0 [200/0] via 30.1.1.1, 00:09:55
r2#show ip ro
     2.0.0.0/24 is subnetted, 1 subnets
C       2.1.1.0 is directly connected, FastEthernet1/0
     20.0.0.0/32 is subnetted, 1 subnets
C       20.1.1.1 is directly connected, Loopback0
     30.0.0.0/32 is subnetted, 1 subnets
O       30.1.1.1 [110/2] via 2.1.1.2, 00:46:41, FastEthernet1/0
r3#  show ip ro  vrf  vpn
Routing Table: vpn
     1.0.0.0/24 is subnetted, 1 subnets
B       1.1.1.0 [200/0] via 20.1.1.1, 00:16:55
     3.0.0.0/24 is subnetted, 1 subnets
C       3.1.1.0 is directly connected, FastEthernet0/0
     5.0.0.0/24 is subnetted, 1 subnets
B       5.1.1.0 [20/0] via 3.1.1.2, 00:10:32
     10.0.0.0/24 is subnetted, 1 subnets
B       10.1.1.0 [200/0] via 20.1.1.1, 00:16:55
     60.0.0.0/24 is subnetted, 1 subnets
B       60.1.1.0 [20/0] via 3.1.1.2, 00:10:32
r3#show  ip ro
     2.0.0.0/24 is subnetted, 1 subnets
C       2.1.1.0 is directly connected, FastEthernet1/0
     20.0.0.0/32 is subnetted, 1 subnets
O       20.1.1.1 [110/2] via 2.1.1.1, 00:47:18, FastEthernet1/0
     30.0.0.0/32 is subnetted, 1 subnets
C       30.1.1.1 is directly connected, Loopback0
r4#  show ip ro  vrf  vpn
Routing Table: vpn
     1.0.0.0/24 is subnetted, 1 subnets
B       1.1.1.0 [20/0] via 3.1.1.1, 00:13:11
     3.0.0.0/24 is subnetted, 1 subnets
C       3.1.1.0 is directly connected, FastEthernet0/0
     5.0.0.0/24 is subnetted, 1 subnets
B       5.1.1.0 [200/0] via 50.1.1.1, 00:12:22
     10.0.0.0/24 is subnetted, 1 subnets
B       10.1.1.0 [20/0] via 3.1.1.1, 00:13:11
     60.0.0.0/24 is subnetted, 1 subnets
B       60.1.1.0 [200/0] via 50.1.1.1, 00:12:22
r4#show  ip  ro
       
     
     50.0.0.0/32 is subnetted, 1 subnets
O       50.1.1.1 [110/2] via 4.1.1.2, 00:53:00, FastEthernet1/0
     4.0.0.0/24 is subnetted, 1 subnets
C       4.1.1.0 is directly connected, FastEthernet1/0
     40.0.0.0/32 is subnetted, 1 subnets
C       40.1.1.1 is directly connected, Loopback0
r5#   show  ip ro  vrf  vpn
Routing Table: vpn
     1.0.0.0/24 is subnetted, 1 subnets
B       1.1.1.0 [200/0] via 40.1.1.1, 00:12:37
     5.0.0.0/24 is subnetted, 1 subnets
C       5.1.1.0 is directly connected, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
B       10.1.1.0 [200/0] via 40.1.1.1, 00:12:37
     60.0.0.0/24 is subnetted, 1 subnets
B       60.1.1.0 [20/0] via 5.1.1.2, 00:26:13
r5#show ip ro
     50.0.0.0/32 is subnetted, 1 subnets
C       50.1.1.1 is directly connected, Loopback0
     4.0.0.0/24 is subnetted, 1 subnets
C       4.1.1.0 is directly connected, FastEthernet1/0
     40.0.0.0/32 is subnetted, 1 subnets
O       40.1.1.1 [110/2] via 4.1.1.1, 00:33:35, FastEthernet1/0
r6#    show ip ro
     1.0.0.0/24 is subnetted, 1 subnets
B       1.1.1.0 [20/0] via 5.1.1.1, 00:14:49
     5.0.0.0/24 is subnetted, 1 subnets
C       5.1.1.0 is directly connected, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
B       10.1.1.0 [20/0] via 5.1.1.1, 00:14:49
     60.0.0.0/24 is subnetted, 1 subnets
C       60.1.1.0 is directly connected, Loopback0
r2#show   mpls     forwarding-table  
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop    
tag    tag or VC   or Tunnel Id      switched   interface              
16     Pop tag     30.1.1.1/32       0          Fa1/0      2.1.1.2      
17     Aggregate   1.1.1.0/24[V]     520                                
18     Untagged    10.1.1.0/24[V]    2280       Fa0/0      1.1.1.1   
r3#show mpls  forwarding-table   
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop    
tag    tag or VC   or Tunnel Id      switched   interface              
16     Pop tag     20.1.1.1/32       0          Fa1/0      2.1.1.1      
17     Untagged    5.1.1.0/24[V]     2280       Fa0/0      3.1.1.2      
18     Untagged    60.1.1.0/24[V]    570        Fa0/0      3.1.1.2 
r4#show     mpls   forwarding-table   
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop    
tag    tag or VC   or Tunnel Id      switched   interface              
16     Pop tag     50.1.1.1/32       0          Fa1/0      4.1.1.2      
17     Untagged    1.1.1.0/24[V]     570        Fa0/0      3.1.1.1      
18     Untagged    10.1.1.0/24[V]    2280       Fa0/0      3.1.1.1  
r5#   show   mpls  forwarding-table   
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop    
tag    tag or VC   or Tunnel Id      switched   interface              
16     Pop tag     40.1.1.1/32       0          Fa1/0      4.1.1.1      
19     Aggregate   5.1.1.0/24[V]     2080                               
20     Untagged    60.1.1.0/24[V]    570        Fa0/0      5.1.1.2