1.实验拓扑
2.配置思路
-
各AS内的MPLS骨干网上分别配置IGP协议,实现各自骨干网ASBR-PE和PE之间的互通。
-
各AS内的MPLS骨干网上分别配置MPLS基本能力和MPLS LDP,建立LDP LSP。
-
各AS内,与CE相连的PE上需配置VPN实例,并把与CE相连的接口和相应的VPN实例绑定。
-
各AS内,PE与CE之间建立EBGP对等体关系,交换VPN路由信息。
-
将域内PE的路由发布给对端PE:先在本端ASBR-PE上通过BGP将域内PE的路由发布给对端ASBR-PE,在远端ASBR-PE上将BGP路由引入到IGP,则远端PE就依靠IGP学到了本端域内PE的路由。
-
在ASBR-PE上配置路由策略:用于向对端ASBR-PE发布的路由,分配MPLS标签。
-
ASBR-PE与对端ASBR-PE之间能够交换带标签的IPv4路由。
-
在ASBR-PE上配置为带标签的公网BGP路由建立LDP LSP。
-
在不同AS间的PE间建立MP-EBGP对等体关系;不同AS间的PE通常不是直连的,为了在它们之间建立EBGP连接,需要配置PE之间允许的最大跳数。
3.实验目的
1.采用optionC2跨域的方式,使其siteA与siteB通信(用7.7.7.7与8.8.8.8通信模拟)
2.siteA采用BGP与PE的交互,siteB采用ospf与PE交互
3.AS域内IGP协议采用OSPF
4.实验步骤
1.配置ip地址,AS域内配置IGP协议、配置mpls LDP协议。
PE-R1配置:
sysname PE-R1
#
mpls lsr-id 1.1.1.1
mpls
#
mpls ldp
#
interface Ethernet0/0/0
ip address 192.168.17.1 255.255.255.0
#
interface Ethernet0/0/1
ip address 192.168.13.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
ospf 1
area 0.0.0.0
network 192.168.13.0 0.0.0.255
network 1.1.1.1 0.0.0.0
#
return
RR-R3配置:
sysname RR-R3
#
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
interface Ethernet0/0/0
ip address 192.168.13.2 255.255.255.0
mpls
mpls ldp
#
interface Ethernet0/0/1
ip address 192.168.32.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
ospf 1
area 0.0.0.0
network 192.168.13.0 0.0.0.255
network 192.168.32.0 0.0.0.255
network 3.3.3.3 0.0.0.0
#
return
ASBR-R2配置:
sysname ASBR-R2
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface Ethernet0/0/0
ip address 192.168.32.2 255.255.255.0
mpls
mpls ldp
#
interface Ethernet0/0/1
ip address 192.168.25.1 255.255.255.0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 192.168.32.0 0.0.0.255
network 2.2.2.2 0.0.0.0
#
return
CE-R7配置:
sysname CE-R7
#
interface Ethernet0/0/0
ip address 192.168.17.2 255.255.255.0
#
interface LoopBack0
ip address 7.7.7.7 255.255.255.255
#
return
PE-R6、RR-R4、ASBR-R5、CE-R8配置与上述配置类似,这里不再赘述。
2.PE与RR建立MP-IBGP邻居关系。
RR-R3配置:
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack0
#
ipv4-family vpnv4
peer 1.1.1.1 enable
peer 1.1.1.1 reflect-client
PE-R1配置:
bgp 100
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
ipv4-family vpnv4
peer 3.3.3.3 enable
ASBR-R2配置:
bgp 100
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
ipv4-family vpnv4
peer 3.3.3.3 enable
PE-R6、RR-R4、ASBR-R5配置与上述配置类似,这里不再赘述。
3.各AS内,与CE相连的PE上需配置VPN实例,并把与CE相连的接口和相应的VPN实例绑定。
PE-R1配置:
ip vpn-instance vpn1
route-distinguisher 100:100
vpn-target 100:1 export-extcommunity
vpn-target 200:1 import-extcommunity
interface Ethernet0/0/0
ip binding vpn-instance vpn1
ip address 192.168.17.1 255.255.255.0
PE-R6配置:
ip vpn-instance vpn1
route-distinguisher 200:200
vpn-target 200:1 export-extcommunity
vpn-target 100:1 import-extcommunity
interface Ethernet0/0/1
ip binding vpn-instance vpn1
ip address 192.168.68.1 255.255.255.0
4.CE-R7与PE-R1采用BGP进行路由交换,CE-R8与PE-R6采用OSPF进行路由交换。
CE-R7配置:
bgp 65000
peer 192.168.17.1 as-number 100
network 7.7.7.7 32
#
PE-R1配置:
bgp 100
ipv4-family vpn-instance vpn1
peer 192.168.17.2 as-number 65000
CE-R8配置:
ospf 2
area 0.0.0.0
network 192.168.68.0 0.0.0.255
network 8.8.8.8 0.0.0.0
#
PE-R6配置:
ospf 2 vpn-instance vpn1
import-route bgp
area 0.0.0.0
network 192.168.68.0 0.0.0.255
bgp 200
ipv4-family vpn-instance vpn1
import-route ospf 2
5.配置标签IPv4路由交换
ASBR-R2配置:
bgp 100
peer 192.168.25.2 as-number 200
peer 192.168.25.2 label-route-capability
int eth 0/0/1
mpls
ASBR-R5配置:
bgp 200
peer 192.168.25.1 as-number 100
peer 192.168.25.1 label-route-capability
int eth 0/0/0
mpls
6.创建路由策略
ASBR-R2配置:
route-policy policy1 permit node 1
apply mpls-label
bgp 100
peer 192.168.25.2 route-policy policy1 export
int eth0/0/1
mpls
ASBR-R5配置:
route-policy policy1 permit node 1
apply mpls-label
bgp 200
peer 192.168.25.1 route-policy policy1 export
int eth 0/0/0
mpls
7.在ASBR上配置为带标签的公网BGP路由建立LDP LSP
ASBR-R2、ASBR-R5配置:
mpls
lsp-trigger bgp-label-route
8.将RR-R3的Loopback路由发布给ASBR-R2,进而发布给RR-R4。
ASBR-R3的配置:
ospf 1
import-route bgp
bgp 100
network 3.3.3.3 255.255.255.255
ASBR-R5配置:
ospf 1
import-route bgp
bgp 200
network 4.4.4.4 255.255.255.255
8.PE-R2与PE-R6建立MP-EBGP对等体关系
RR-R2配置:
bgp 100
peer 4.4.4.4 as-number 200
peer 4.4.4.4 ebgp-max-hop 10
peer 4.4.4.4 connect-interface LoopBack0
ipv4-family vpnv4
undo policy vpn-target
peer 4.4.4.4 enable
RR-R4配置:
bgp 200
peer 3.3.3.3 as-number 100
peer 3.3.3.3 ebgp-max-hop 10
peer 3.3.3.3 connect-interface LoopBack0
ipv4-family vpnv4
undo policy vpn-target
peer 3.3.3.3 enable