MPLS VPN Hub and Spoke实验
实验拓扑
实验要求
1.R6与R7通信需要经过R1,不可以直通
2.HUB-CE,SPOKE-CE在同一个AS(allow
-as-loop的合理使用)
3.各个PE与CE之间均为EBGP关系(也可以做IBGP,OSPF)
配置
1.R2,3,4,5配置路由,并启用ospf
2.PE之间配置MP-BGP邻居关系
(减少IBGP邻居的建立使用 RR 反射器,其中R2充当反射器最为合适)
3.R2,3,4,5启用MPLS
3.SPOKE-PE配置VPN实例,并进入接口进行绑定
4.HUB-PE上配置只进的VPN实例,和只出的VPN实例
5.配置PE与CE间路由交换(允许路由环路)
测试:
R2上dis bgp vpnv4 vpn-instance in routing-table
R2上dis bgp vpnv4 vpn-instance out routing-table
R6pingR7
全部配置:
R1
#
sysname R1
#
interface GigabitEthernet0/0/0
ip address 10.1.12.1 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.2.12.1 255.255.255.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 10.1.1.1 255.255.255.0
#
bgp 10
peer 10.1.12.2 as-number 100
peer 10.2.12.2 as-number 100
#
ipv4-family unicast
undo synchronization
network 10.1.1.0 255.255.255.0
peer 10.1.12.2 enable
peer 10.1.12.2 allow-as-loop
peer 10.2.12.2 enable
peer 10.2.12.2 allow-as-loop
#
R2
#
sysname R2
#
ip vpn-instance in
ipv4-family
route-distinguisher 2:2
vpn-target 1:1 1:2 import-extcommunity
#
ip vpn-instance out
ipv4-family
route-distinguisher 2:1
vpn-target 2:1 export-extcommunity
#
mpls lsr-id 10.2.2.2
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
ip binding vpn-instance in
ip address 10.1.12