BGP/MPLS 虛擬專用網路 Option B RR

魚煜發表於2020-12-18

圖一拓撲圖

一、實驗目的

 1.配置BGP/MPLS 虛擬專用網路 Option B RR

二.BGP/MPLS 虛擬專用網路 Option B RR

1.底層路由協議可以配置為OSPFISIS2.利用MPLS為每條路由或每個例項分配一個標籤,進行資料包的傳輸
3.利用BGP VPNv4傳遞私網路由
4.ASBR之間相連的介面,使能MPLS功能,為私網路由分配標籤
5.RR上不儲存路由,只傳遞路由。
6.RR就是BGP中的反射器

三、簡單配置

1.CE_1

sysname CE_1
#
interface GigabitEthernet0/0/0
 ip address 10.0.12.1 255.255.255.0 
#
interface LoopBack1
 ip address 1.1.1.1 255.255.255.255 
#
bgp 65001
 peer 10.0.12.2 as-number 100 
 #
 ipv4-family unicast
  undo synchronization
  network 1.1.1.1 255.255.255.255 
  peer 10.0.12.2 enable
#
return

2.PE_1

sysname PE_1
#
ip vpn-instance vpna
 ipv4-family
  route-distinguisher 1:1
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 import-extcommunity
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip binding vpn-instance vpna
 ip address 10.0.12.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.0.13.1 255.255.255.0 
 mpls
 mpls ldp
#
interface LoopBack1
 ip address 2.2.2.2 255.255.255.255 
#
bgp 100
 peer 9.9.9.9 as-number 100 
 peer 9.9.9.9 connect-interface LoopBack1
 #
 ipv4-family unicast
  undo synchronization
  undo peer 9.9.9.9 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 9.9.9.9 enable
 #
 ipv4-family vpn-instance vpna 
  peer 10.0.12.1 as-number 65001 
#
ospf 1 
 area 0.0.0.0 
  network 2.2.2.2 0.0.0.0 
  network 10.0.13.0 0.0.0.0 
  network 10.0.13.0 0.0.0.255 
#
return

3.RR1

sysname RR1
#
mpls lsr-id 9.9.9.9
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.0.19.2 255.255.255.0 
 mpls
 mpls ldp
#
interface LoopBack1
 ip address 9.9.9.9 255.255.255.255 
#
bgp 100
 peer 2.2.2.2 as-number 100 
 peer 2.2.2.2 connect-interface LoopBack1
 peer 4.4.4.4 as-number 100 
 peer 4.4.4.4 connect-interface LoopBack1
 #
 ipv4-family unicast
  undo synchronization
  peer 2.2.2.2 enable
  peer 4.4.4.4 enable
 # 
 ipv4-family vpnv4
  undo policy vpn-target
  peer 2.2.2.2 enable
  peer 2.2.2.2 reflect-client
  peer 4.4.4.4 enable
  peer 4.4.4.4 reflect-client
#
ospf 1 
 area 0.0.0.0 
  network 9.9.9.9 0.0.0.0 
  network 10.0.19.0 0.0.0.255 
#
return

4.ASBR_PE1

sysname ASBR_PE1
#
mpls lsr-id 4.4.4.4
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.0.14.2 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.0.15.1 255.255.255.0 
 mpls
#
interface LoopBack1
 ip address 4.4.4.4 255.255.255.255 
#
bgp 100
 peer 9.9.9.9 as-number 100 
 peer 9.9.9.9 connect-interface LoopBack1
 peer 10.0.15.2 as-number 200 
 #
 ipv4-family unicast
  undo synchronization
  peer 9.9.9.9 enable
  peer 10.0.15.2 enable
 # 
 ipv4-family vpnv4
  undo policy vpn-target
  peer 9.9.9.9 enable
  peer 10.0.15.2 enable
#
ospf 1 
 area 0.0.0.0 
  network 4.4.4.4 0.0.0.0 
  network 10.0.14.0 0.0.0.255 
#
return

5.P_2

 sysname P_2
#
mpls lsr-id 6.6.6.6
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.0.16.2 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.0.17.1 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet2/0/0
 ip address 10.0.20.1 255.255.255.0 
 mpls
 mpls ldp
#
interface LoopBack1
 ip address 6.6.6.6 255.255.255.255 
#
ospf 1 
 area 0.0.0.0 
  network 6.6.6.6 0.0.0.0 
  network 10.0.16.0 0.0.0.255 
  network 10.0.17.0 0.0.0.255 
  network 10.0.20.0 0.0.0.255 
#
return

6.RR2

sysname RR2
#
mpls lsr-id 10.10.10.10
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.0.20.2 255.255.255.0 
 mpls
 mpls ldp
#
interface LoopBack1
 ip address 10.10.10.10 255.255.255.255 
#
bgp 200
 peer 5.5.5.5 as-number 200 
 peer 5.5.5.5 connect-interface LoopBack1
 peer 7.7.7.7 as-number 200 
 peer 7.7.7.7 connect-interface LoopBack1
 #
 ipv4-family unicast
  undo synchronization
  peer 5.5.5.5 enable
  peer 7.7.7.7 enable
 # 
 ipv4-family vpnv4
  undo policy vpn-target
  peer 5.5.5.5 enable
  peer 5.5.5.5 reflect-client
  peer 7.7.7.7 enable
  peer 7.7.7.7 reflect-client
#
ospf 1 
 area 0.0.0.0 
  network 10.0.20.0 0.0.0.255 
  network 10.10.10.10 0.0.0.0 
#
return

7.PE_2

sysname PE_2
#
ip vpn-instance vpna
 ipv4-family
  route-distinguisher 1:2
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 import-extcommunity
#
mpls lsr-id 7.7.7.7
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip binding vpn-instance vpna
 ip address 10.0.18.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.0.17.2 255.255.255.0 
 mpls
 mpls ldp
#
interface LoopBack1
 ip address 7.7.7.7 255.255.255.255 
#
bgp 200
 peer 10.10.10.10 as-number 200 
 peer 10.10.10.10 connect-interface LoopBack1
 #
 ipv4-family unicast
  undo synchronization
  peer 10.10.10.10 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 10.10.10.10 enable
 #
 ipv4-family vpn-instance vpna 
  import-route ospf 2
#
ospf 1 
 area 0.0.0.0 
  network 7.7.7.7 0.0.0.0 
  network 10.0.17.0 0.0.0.255 
#
ospf 2 vpn-instance vpna
 import-route bgp
 area 0.0.0.0 
  network 10.0.18.0 0.0.0.255 
#
return

8.CE_2

sysname CE_2
#
interface GigabitEthernet0/0/0
 ip address 10.0.18.2 255.255.255.0 
#
interface LoopBack1
 ip address 8.8.8.8 255.255.255.255 
#
ospf 1 
 area 0.0.0.0 
  network 8.8.8.8 0.0.0.0 
  network 10.0.18.0 0.0.0.255 
#
return

相關文章