BGP/MPLS 虚拟专用网络 Option C 1

图一拓扑图

一、实验目的

1.配置BGP/MPLS 虚拟专用网络 Option C 1

二、BGP/MPLS 虚拟专用网络 Option C 1

1.底层路由协议可以配置为OSPFISIS2.利用MPLS为每条路由或每个实例分配一个标签,进行数据包的传输
3.利用BGP VPNv4传递私网路由
4.ASBR相连的接口,使能MPLS功能
5.ASBR之间,建立EBGP关系,传递公网路由
6.PE之间利用彼此的,公网路由建立BGP VPNv4邻居关系

三、简单查询命令

1.第一层标签:display bgp v4 all routing-table label是VPNv4标签,
2.第二层标签:display mpls lsp verbose是BGP 标签利用 label-route-capability命令打的
3.第三层标签:display mpls lsp verbose是LDP标签,也是公网标签

四、简单配置

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 -instance a
 ipv4-family
  route-distinguisher 1:1
  -target 1:1 export-extcommunity
  -target 1:1 import-extcommunity
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip binding -instance a
 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 4.4.4.4 as-number 100 
 peer 4.4.4.4 connect-interface LoopBack1
 peer 7.7.7.7 as-number 200 
 peer 7.7.7.7 ebgp-max-hop 10 
 peer 7.7.7.7 connect-interface LoopBack1
 #
 ipv4-family unicast
  undo synchronization
  peer 4.4.4.4 enable
  peer 4.4.4.4 route-policy PE-AS export
  peer 4.4.4.4 label-route-capability
  peer 7.7.7.7 enable
 # 
 ipv4-family v4
  policy -target
  peer 7.7.7.7 enable
 #
 ipv4-family -instance a 
  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.255 
#
route-policy PE-AS permit node 10 
 apply mpls-label
#
return

3.P_1

sysname P_1
#
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.0.14.1 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.0.13.2 255.255.255.0 
 mpls
 mpls ldp
#
interface LoopBack3
 ip address 3.3.3.3 255.255.255.255 
#
ospf 1 
 area 0.0.0.0 
  network 3.3.3.3 0.0.0.0 
  network 10.0.13.0 0.0.0.255 
  network 10.0.14.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 2.2.2.2 as-number 100 
 peer 2.2.2.2 connect-interface LoopBack1
 peer 10.0.15.2 as-number 200 
 #
 ipv4-family unicast
  undo synchronization
  network 2.2.2.2 255.255.255.255 
  peer 2.2.2.2 enable
  peer 2.2.2.2 route-policy AS-PE export
  peer 2.2.2.2 label-route-capability
  peer 10.0.15.2 enable
  peer 10.0.15.2 route-policy AS-AS export
  peer 10.0.15.2 label-route-capability
 # 
 ipv4-family v4
  policy -target
#
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 
#
route-policy AS-AS permit node 10 
 apply mpls-label
#
route-policy AS-PE permit node 10 
 if-match mpls-label 
 apply mpls-label
#
return

5.ASBR_PE2

sysname ASBR_PE2
#
mpls lsr-id 5.5.5.5
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.0.16.1 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.0.15.2 255.255.255.0 
 mpls
#
interface LoopBack1
 ip address 5.5.5.5 255.255.255.255 
#
bgp 200
 peer 7.7.7.7 as-number 200 
 peer 7.7.7.7 connect-interface LoopBack1
 peer 10.0.15.1 as-number 100 
 #
 ipv4-family unicast
  undo synchronization
  network 7.7.7.7 255.255.255.255 
  peer 7.7.7.7 enable
  peer 7.7.7.7 route-policy AS-PE export
  peer 7.7.7.7 label-route-capability
  peer 10.0.15.1 enable
  peer 10.0.15.1 route-policy AS-AS export
  peer 10.0.15.1 label-route-capability
 # 
 ipv4-family v4
  policy -target
#
ospf 1 
 area 0.0.0.0 
  network 5.5.5.5 0.0.0.0 
  network 10.0.16.0 0.0.0.255 
#
route-policy AS-AS permit node 10 
 apply mpls-label
#
route-policy AS-PE permit node 10 
 if-match mpls-label 
 apply mpls-label
#
return

6.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 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 
#
return

7.PE_2

sysname PE_2
#
ip -instance a
 ipv4-family
  route-distinguisher 1:1
  -target 1:1 export-extcommunity
  -target 1:1 import-extcommunity
#
mpls lsr-id 7.7.7.7
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip binding -instance a
 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 2.2.2.2 as-number 100 
 peer 2.2.2.2 ebgp-max-hop 10 
 peer 2.2.2.2 connect-interface LoopBack1
 peer 5.5.5.5 as-number 200 
 peer 5.5.5.5 connect-interface LoopBack1
 #
 ipv4-family unicast
  undo synchronization
  peer 2.2.2.2 enable
  peer 5.5.5.5 enable
  peer 5.5.5.5 route-policy PE-AS export
  peer 5.5.5.5 label-route-capability
 # 
 ipv4-family v4
  policy -target
  peer 2.2.2.2 enable
 #
 ipv4-family -instance a 
  peer 10.0.18.2 as-number 65002 
#
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 
#
route-policy PE-AS permit node 10 
 apply mpls-label
#
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 
#
bgp 65002
 peer 10.0.18.1 as-number 200 
 #
 ipv4-family unicast
  undo synchronization
  network 8.8.8.8 255.255.255.255 
  peer 10.0.18.1 enable
#
return

你可能感兴趣的:(BGP/MPLS,MPLS,BGP,BGP/MPLS,虚拟专用网络,LDP,OSPF)