好消息,超酷的在线虚拟网络实验室上线了!点击开始实验

为获得更好的浏览效果,建议您使用 Firefox 或者 Chrome 浏览器



MSR系列路由器

MPLS L3VPN HubSpoke配置

 

关键词:MSR;MPLS;BGP;L3VPN;HubSpoke

 

一、组网需求

SPOKEASPOKEBvpna2个分布站点接入PE,总部站点用CE表示,CE的接入PEHub,要求SPOKEASPOKEB之间的VPN流量都需要从总部站点转发。

设备清单:MSR系列路由器4

二、组网图:

三、配置步骤:

SpokeA配置

#

router id 2.2.2.2

#

ip vpn-instance vpna

route-distinguisher 2:1

vpn-target 2:1 export-extcommunity    //配置vpna出团体属性

vpn-target 1:1 import-extcommunity     //配置vpna入团体属性

#

mpls lsr-id 2.2.2.2

#

mpls

ttl propagate vpn          //使能vpnttl复制,用于tracert

#

mpls ldp

#

interface Ethernet0/0

port link-mode route

ip address 1.2.3.2 255.255.255.0

mpls

mpls ldp

#

interface Ethernet0/1

 port link-mode route

ip binding vpn-instance vpna     //绑定vpn实例vpna

ip address 172.32.0.1 255.255.255.0

#

interface LoopBack0

ip address 2.2.2.2 255.255.255.255

#

bgp 1

undo synchronization

peer 1.1.1.1 as-number 1

peer 1.1.1.1 connect-interface LoopBack0

#

ipv4-family vpnv4

peer 1.1.1.1 enable

#

ipv4-family vpn-instance vpna

import-route direct

#

ospf 1

area 0.0.0.0

network 2.2.2.2 0.0.0.0

network 1.2.3.0 0.0.0.255

#

SpokeB配置

#

router id 3.3.3.3

#

ip vpn-instance vpna

route-distinguisher 3:1

vpn-target 3:1 export-extcommunity     //配置vpna出团体属性

vpn-target 1:1 import-extcommunity     //配置vpna入团体属性

#

mpls lsr-id 3.3.3.3

#

mpls

ttl propagate vpn          //使能vpnttl复制,用于tracert

#

mpls ldp

#

interface Ethernet0/0

port link-mode route

ip address 1.2.3.3 255.255.255.0

mpls

mpls ldp

#

interface Ethernet0/1

port link-mode route

ip binding vpn-instance vpna     //绑定vpn实例vpna

ip address 172.32.1.1 255.255.255.0

#

interface LoopBack0

ip address 3.3.3.3 255.255.255.255

#

bgp 1

undo synchronization

peer 1.1.1.1 as-number 1

peer 1.1.1.1 connect-interface LoopBack0

#

ipv4-family vpnv4

peer 1.1.1.1 enable

#

ipv4-family vpn-instance vpna

network 172.32.1.0 255.255.255.0

#

ospf 1                      //OSPF保证全网互通

area 0.0.0.0

network 3.3.3.3 0.0.0.0

network 1.2.3.0 0.0.0.255

#

Hub配置

#

router id 1.1.1.1

#

ip vpn-instance vpnin

route-distinguisher 1:2

vpn-target 2:1 3:1 import-extcommunity //入团体属性

#

ip vpn-instance vpnout

route-distinguisher 1:1

vpn-target 1:1 export-extcommunity        //出团体属性

#

mpls lsr-id 1.1.1.1

#

mpls

ttl propagate vpn          //使能vpnttl复制,用于tracert

#

mpls ldp

#

interface Ethernet0/0

port link-mode route

ip address 1.2.3.1 255.255.255.0

mpls

mpls ldp

#

interface Ethernet0/1

 port link-mode route

ip binding vpn-instance vpnout   //绑定vpn实例vpnout

ip address 192.168.1.1 255.255.255.0

#

interface Ethernet1/0

port link-mode route

ip binding vpn-instance vpnin //绑定vpn实例vpnin

ip address 192.168.0.1 255.255.255.0

#

interface LoopBack0

ip address 1.1.1.1 255.255.255.255

#

bgp 1

undo synchronization

group 1 internal

peer 1 connect-interface LoopBack0

peer 3.3.3.3 group 1

peer 2.2.2.2 group 1

#

ipv4-family vpnv4

peer 1 enable

peer 2.2.2.2 enable

peer 2.2.2.2 group 1

peer 3.3.3.3 enable

peer 3.3.3.3 group 1

#

ipv4-family vpn-instance vpnin   //vpnin的路由和peer配置

peer 192.168.0.2 as-number 2 //CEA建立EBGP连接

#

ipv4-family vpn-instance vpnout  //vpnout的路由和peer配置

peer 192.168.1.2 as-number 2 //CEA建立EBGP连接

network 192.168.1.0

peer 192.168.1.2 allow-as-loop  //必配,使能接受路由环路

#

ospf 1

area 0.0.0.0

network 1.1.1.1 0.0.0.0

network 1.2.3.0 0.0.0.255

#

CE配置

#

interface Ethernet0/1

 port link-mode route

ip address 192.168.1.2 255.255.255.0

#

interface Ethernet1/0

port link-mode route

ip address 192.168.0.2 255.255.255.0

#

bgp 2

network 192.168.0.0

undo synchronization

peer 192.168.1.1 as-number 1

peer 192.168.0.1 as-number 1

group 1 external

peer 192.168.1.1 group 1

peer 192.168.0.1 group 1

#

四、配置关键点

1.      掌握VPN路由的流向;

2.      注意Spokevpn-target的配置;

3.      Hub上配置2vpn实例及其vpn-target配置;

4.      HubBGP配置,需要与CE建立2EBGP连接,都配置在vpn实例视图下;

5.      Hubvpnout实例要配置接受环路路由

五、实验分析

*

X Close
X Close