H3C S9500交换机MPLS BGP VPN的OSPF多实例Sham-link组网的配置

更新时间:2023-09-09 01:56:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

?

H3C S9500交换机MPLS BGP VPN的OSPF多实

例Sham-link组网的配置

一、组网需求:

一个公司通过Quidway路由器的OSPF多实例功能连接到广域网,其中OSPF绑定于VPN1。

PE之间是MPLS VPN骨干网,PE和CE之间运行OSPF。在PE1和PE2之间配置一条Sham-link,使得CE1和CE2之间的流量正常情况下不会通过CE1和CE2之间直接相连的链路(Backdoor link),当MPLS骨干网络出现故障时,流量又能切换到CE1和CE2之间直接相连的链路(Backdoor link)。

如下图所示,PE1和PE2为服务运行商PE,CE 1和CE2为用户设备,PE1和PE2之间为

MPLS骨干网,在PE1和PE2的VPN下配置Sham-link,CE1和CE2之间有一条Back Door链路。网络正常情况下情况数据转发为CE1<-->PE1<-->PE2<-->CE2,当MPLS骨干网络故障时,可以走Back Door,即CE1<-->CE2。 二、组网图

三、配置步骤:

软件版本:S9500交换机1200以后软件版本 硬件版本:S9500交换机C/CA/CB类型业务板 配置PE1设备

1)全局使能MPLS及LDP

[PE1] mpls lsr-id 50.1.1.1 [PE1] mpls

[PE1] mpls ldp 2)创建VPN实例

[PE1] ip vpn-instance vpn1

[PE1-vpn-vpn1] route-distinguisher 2:1

[PE1-vpn-vpn1] vpn-target 100:1 export-extcommunity [PE1-vpn-vpn1] vpn-target 100:1 import-extcommunity

3)配置MPLS骨干网络的(公网侧)VLAN接口和环回口,并在VLAN接口使能MPLS和LDP

[PE1] vlan 203

[PE1-vlan203] port gigabitethernet 2/1/3

[PE1] interface vlan-interface 203

[PE1-vlan-interface203] ip address 168.1.12.1 255.255.255.0 [PE1-vlan-interface203] mpls

[PE1-vlan-interface203] mpls ldp enable

[PE1-vlan-interface203] mpls ldp transport-ip interface [PE1] interface loopback1

[PE1-LoopBack1] ip address 50.1.1.1 255.255.255.255 4)配置VPN的(私网侧)VLAN接口和环回口,并绑定VPN实例 [PE1] vlan 201

[PE1-vlan201] port gigabitethernet 2/1/1

[PE1] interface vlan-interface 201

[PE1-vlan-interface201] ip binding vpn-instance vpn1 [PE1-vlan-interface201] ip address 10.1.1.2 255.255.255.0 5)配置OSPF的花费(ospf cost配置小于Back Door的cost值) [PE1-vlan-interface201] ospf cost 1 6)配置环回口,并绑定VPN实例

[PE1] interface loopback0

[PE1-LoopBack0] ip binding vpn-instance vpn1

[PE1-LoopBack0] ip address 1.1.1.1 255.255.255.255

7)配置公网侧BGP Peer,并在BGP的VPN实例下引入OSPF和直连路由 [PE1] bgp 100

[PE1-bgp] group group1 internal

[PE1-bgp] peer 50.1.1.2 group group1

[PE1-bgp] peer 50.1.1.2 connect-interface LoopBack1 [PE1-bgp] ipv4-family vpn-instance vpn1

[PE1-bgp-af-vpn-instance] import-route ospf 100 [PE1-bgp-af-vpn-instance] import-route ospf-ase 100 [PE1-bgp-af-vpn-instance] import-route ospf-nssa 100 [PE1-bgp-af-vpn-instance] import-route direct 8)在MBGP下建立VPNv4邻居并激活

[PE1-bgp-af-vpn] ipv4-family vpnv4

[PE1-bgp-af-vpn] peer group1 enable

[PE1-bgp-af-vpn] peer 50.1.1.2 group group1

9)配置私网侧OSPF实例(绑定到VPN实例),并引入BGP路由(一定不可以配置引入直连路由,也不可以发布Sham-link的环回口IP) [PE1] ospf 100 router-id 1.1.1.1 vpn-instance vpn1 [PE1-ospf-100] import-route bgp

[PE1-ospf-100] area 0.0.0.0

[PE1-ospf-100-area-0.0.0.0] network 10.1.1.0 0.0.0.255 10)配置Sham-link

[PE1-ospf-100-area-0.0.0.0] sham-link 1.1.1.1 2.2.2.2 11)配置公网OSPF路由,使PE1和PE2之间路由可达 [PE1] ospf 1000

[PE1-ospf-1000] area 0

[PE1-ospf-1000-area-0.0.0.0] network 168.12.1.0 0.0.0.255 [PE1-ospf-1000-area-0.0.0.0] network 50.1.1.1 0.0.0.0 配置PE2设备

1)全局使能MPLS及LDP [PE2] mpls lsr-id 50.1.1.2 [PE2] mpls [PE2] mpls ldp

2)创建VPN实例

[PE2] ip vpn-instance vpn1

[PE2-vpn-vpn1] route-distinguisher 2:1

[PE2-vpn-vpn1] vpn-target 100:1 export-extcommunity [PE2-vpn-vpn1] vpn-target 100:1 import-extcommunity

3)配置MPLS骨干网络的(公网侧)VLAN接口和环回口,并在VLAN接口使能MPLS和LDP

[PE2] vlan 203

[PE2-vlan203] port gigabitethernet 2/1/3

[PE2] interface vlan-interface 203

[PE2-vlan-interface203] ip address 168.1.12.2 255.255.255.0 [PE2-vlan-interface203] mpls

[PE2-vlan-interface203] mpls ldp enable

[PE2-vlan-interface203] mpls ldp transport-ip interface [PE2] interface LoopBack1

[PE2-LoopBack1] ip address 50.1.1.2 255.255.255.255

4)配置VPN的(私网侧)VLAN接口和环回口,并绑定VPN实例(ospf cost配置必须小于Back Door的cost值) [PE2] vlan 201

[PE2-vlan201] port gigabitethernet 2/1/1

[PE2] interface vlan-interface 201

[PE2-vlan-interface201] ip binding vpn-instance vpn1 [PE2-vlan-interface201] ip address 20.1.1.2 255.255.255.0 [PE2-vlan-interface201] ospf cost 1 [PE2-vlan-interface201] quit [PE2] interface LoopBack0

[PE2-LoopBack0] ip binding vpn-instance vpn1

[PE2-LoopBack0] ip address 2.2.2.2 255.255.255.255

[PE2-LoopBack0] quit

5)配置公网侧BGP Peer,并在BGP的VPN实例下引入OSPF和直连路由 [PE2] bgp 100

[PE2-bgp] group group1 internal

[PE2-bgp] peer 50.1.1.1 group group1

[PE2-bgp] peer 50.1.1.1 connect-interface LoopBack1 [PE2-bgp] ipv4-family vpn-instance vpn1

[PE2-bgp-af-vpn-instance] import-route direct

[PE2-bgp-af-vpn-instance] import-route ospf-nssa 100 [PE2-bgp-af-vpn-instance] import-route ospf-ase 100 [PE2-bgp-af-vpn-instance] import-route ospf 100 6)在MBGP下建立VPNv4邻居并激活 [PE2-bgp-af-vpn] ipv4-family vpnv4 [PE2-bgp-af-vpn] peer group1 enable

[PE2-bgp-af-vpn] peer 50.1.1.1 group group1

7)配置私网侧OSPF实例(绑定到VPN实例),并引入BGP路由(一定不可以配置引入直连路由,且不可以发布Sham-link的环回口IP) [PE2] ospf 100 router-id 2.2.2.2 vpn-instance vpn1 [PE2-ospf-100] import-route bgp [PE2-ospf-100] import-route static

[PE2-ospf-100] area 0.0.0.0

[PE2-ospf-100-area-0.0.0.0] network 20.1.1.0 0.0.0.255 8)配置Sham-link

[PE2-ospf-100-area-0.0.0.0] sham-link 2.2.2.2 1.1.1.1 9)配置公网OSPF路由,使PE1和PE2之间路由可达 [PE2] ospf 1000

[PE2-ospf-1000]area 0

[PE2-ospf-1000-area-0.0.0.0] network 168.12.1.0 0.0.0.255 [PE2-ospf-1000-area-0.0.0.0] network 50.1.1.2 0.0.0.0 配置

CE1设备

1)配置VLAN及接口地址,配置OSPF的花费(CE间互连VLAN的ospf cost大于MPLS骨干的cost值总和,CE和PE互连VLAN的ospf cost配置小于Back Door的cost值)

[CE1] vlan 202

[CE1-vlan202] port gigabitethernet 2/1/2 [CE1-vlan202] quit

[CE1] interface vlan-interface 202

[CE1-vlan-interface202] ip address 12.1.1.1 255.255.255.0 [CE1-vlan-interface202] ospf cost 100 [CE1] vlan 201

[CE1-vlan201] port gigabitethernet 2/1/1

[CE1] interface vlan-interface 201

[CE1-vlan-interface201] ip address 10.1.1.1 255.255.255.0 [CE1-vlan-interface201] ospf cost 1

2)配置OSPF路由,使CE1和CE2以及CE1和PE1之间路由可达。 [CE1] ospf 100 router-id 10.10.10.10 [CE1-ospf-100] import-route direct

[CE1-ospf-100] area 0.0.0.0

[CE1-ospf-100-area-0.0.0.0] network 10.1.1.0 0.0.0.255 [CE1-ospf-100-area-0.0.0.0] network 12.1.1.0 0.0.0.255

四、配置CE2

1)配置VLAN及接口地址,配置OSPF的花费(CE间互连VLAN的ospf cost大于MPLS骨干的cost值总和,CE和PE互连VLAN的ospf cost配置小于Back Door的cost值) [CE2] vlan 202

[CE2-vlan202] port gigabitethernet 2/1/2 [CE2] interface vlan-interface 202

[CE2-vlan-interface202] ip address 12.1.1.2 255.255.255.0 [CE2-vlan-interface202] ospf cost 100 [CE2] vlan 201

[CE2-vlan201] port gigabitethernet 2/1/1

[CE2] interface vlan-interface 201

[CE2-vlan-interface201] ip address 20.1.1.1 255.255.255.0 [CE2-vlan-interface201] ospf cost 1

2)配置OSPF路由,使CE1和CE2以及CE2和PE2之间路由可达 [CE2] ospf 100 router-id 20.20.20.20 [CE2-ospf-100] area 0.0.0.0

[CE2-ospf-100-area-0.0.0.0] network 12.1.1.0 0.0.0.255 [CE2-ospf-100-area-0.0.0.0] network 20.1.1.0 0.0.0.255 四、配置关键点:

1)PE公网侧端口的单板需要支持MPLS的单板;

2)配置BGP邻居时,必须指定源IP(Peer x.x.x.x connect-interface xx); 3)OSPF的VPN实例下不可以引入直连路由或者使用network发布Sham-link环回口(因为Sham-link环回口路由需要BGP发布到对方); 4)OSPF的VPN实例下需要引入BGP;BGP的VPN实例下需要引入OSPF/OSPF-ASE/OSPF-NSSA等。

本文来源:https://www.bwwdw.com/article/smkh.html

Top