BGP/MPLS ***實驗
實驗描述:
上圖共有六個路由器,其中P1、P2、PE1、PE2爲ISP路由器,CE1、CE2爲私網用戶的出口路由器,在CE1、CE2上用L0接口來模擬用戶私有網絡。
PE1連接CE1,在PE1上創建一個***實例,命名***,RD爲100:1,RT爲100:1,PE2連接CE2,在PE2上創建一個***實例,命名***,RD爲100:1,RT爲100:1.
ISP的路由器都在一個AS 100中,CE1和PE1之間運行EBGP協議,CE1所在的AS爲1000; CE2和PE2之間運行EBGP協議,CE2所在的AS爲2000.
要求:CE1連接的私網用戶可以訪問CE2下的私網用戶。
CE1#show run
hostname CE1
!
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
End
PE1#show run
!
hostname PE1
!
no ip domain lookup
!
ip vrf ***
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 ***
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.0 0.0.0.255 area 0
!
router bgp 100
no synchronization
bgp log-neighbor-changes
neighbor 50.1.1.1 remote-as 100
neighbor 50.1.1.1 update-source Loopback0
no auto-summary
!
address-family ***v4
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 ***
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 classles
!
line con 0
exec-timeout 0 0
logging synchronous
End
P1#show run
hostname P1
!
no ip domain lookup
!
ip cef
!
interface Loopback0
ip address 30.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 3.1.1.1 255.255.255.0
duplex half
tag-switching ip
!
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.0 0.0.0.255 area 0
network 3.1.1.0 0.0.0.255 area 0
network 30.1.1.0 0.0.0.255 area 0
!
ip classless
line con 0
exec-timeout 0 0
logging synchronous
!
End
P2#show run
hostname r4
!
no ip domain lookup
!
ip cef
!
interface Loopback0
ip address 40.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 3.1.1.2 255.255.255.0
duplex half
tag-switching ip
!
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 0.0.0.0 255.255.255.255 area 0
!
ip classless
!
line con 0
exec-timeout 0 0
logging synchronous
!
End
PE2#show run
hostname PE2
no ip domain lookup
!
ip vrf ***
rd 100: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 ***
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.0 0.0.0.255 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 ***v4
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 ***
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
CE2#show run
hostname CE2
!
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
!
!
router bgp 2000
bgp log-neighbor-changes
neighbor 5.1.1.1 remote-as 100
redistribute connected
neighbor 5.1.1.1 activate
no auto-summary
no synchronization
!
ip classless
!
!
line con 0
exec-timeout 0 0
logging synchronous
!
end