华为运营商级路由器配置示例 | 配置OptionA方式跨域BGP VPLS示例

Posted 一个热爱编程的通信人

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了华为运营商级路由器配置示例 | 配置OptionA方式跨域BGP VPLS示例相关的知识,希望对你有一定的参考价值。

组网需求

图1,CE1和CE2属于同一个VPLS,分别通过AS100内的PE1和AS200内的PE2接入骨干网。

由于VPLS数量较少,因此本示例采用OptionA方式跨域BGP VPLS,ASBR间的接口被当作AC接口与VSI实例定,实现CE1与CE2的互通。

图1 配置OptionA方式跨域BGP VPLS组网图

 配置思路

  1. 在骨干网上运行IGP协议实现ASBR与PE之间的互通,并且PE之间要建立隧道。

  2. PE与域内的ASBR建立MP-IBGP对等体关系。

  3. 在PE1、ASBR1、ASBR2和PE2上配置VSI实例,并与AC接口绑定。

操作步骤

1.配置各设备接口的IP地址

# 配置CE1。

<HUAWEI> system-view
[~HUAWEI] sysname CE1
[*HUAWEI] commit
[~CE1] interface gigabitethernet 1/0/0
[*CE1-GigabitEthernet1/0/0] undo shutdown
[*CE1-GigabitEthernet1/0/0] quit
[*CE1] interface gigabitethernet 1/0/0.1
[*CE1-GigabitEthernet1/0/0.1] ip address 10.1.1.1 24
[*CE1-GigabitEthernet1/0/0.1] quit
[*CE1] commit

# 配置PE1。

<HUAWEI> system-view
[~HUAWEI] sysname PE1
[*HUAWEI] commit
[~PE1] interface loopback1
[*PE1-Loopback1] ip address 1.1.1.1 32
[*PE1-Loopback1] quit
[*PE1] interface gigabitethernet 1/0/0
[*PE1-GigabitEthernet1/0/0] undo shutdown
[*PE1-GigabitEthernet1/0/0] quit
[*PE1] interface gigabitethernet 1/0/0.1
[*PE1-GigabitEthernet1/0/0.1] quit
[*PE1] interface gigabitethernet 2/0/0
[*PE1-GigabitEthernet2/0/0] undo shutdown
[*PE1-GigabitEthernet2/0/0] ip address 10.10.1.1 24
[*PE1-GigabitEthernet2/0/0] quit
[*PE1] commit

# 配置ASBR1。

<HUAWEI> system-view
[~HUAWEI] sysname ASBR1
[*HUAWEI] commit
[~ASBR1] interface loopback1
[*ASBR1-Loopback1] ip address 2.2.2.2 32
[*ASBR1-Loopback1] quit
[*ASBR1] interface gigabitethernet 1/0/0
[*ASBR1-GigabitEthernet1/0/0] undo shutdown
[*ASBR1-GigabitEthernet1/0/0] ip address 10.10.1.2 24
[*ASBR1-GigabitEthernet1/0/0] quit
[*ASBR1] interface gigabitethernet 2/0/0
[*ASBR1-GigabitEthernet2/0/0] undo shutdown
[*ASBR1-GigabitEthernet2/0/0] quit
[*ASBR1] interface gigabitethernet 2/0/0.1
[*ASBR1-GigabitEthernet2/0/0.1] quit
[*ASBR1] commit

# 配置ASBR2。

<HUAWEI> system-view
[~HUAWEI] sysname ASBR2
[*HUAWEI] commit
[~ASBR2] interface loopback1
[*ASBR2-Loopback1] ip address 3.3.3.3 32
[*ASBR2-Loopback1] quit
[*ASBR2] interface gigabitethernet 1/0/0
[*ASBR2-GigabitEthernet1/0/0] undo shutdown
[*ASBR2-GigabitEthernet1/0/0] quit
[*ASBR2] interface gigabitethernet 1/0/0.1
[*ASBR2-GigabitEthernet1/0/0.1] quit
[*ASBR2] interface gigabitethernet 2/0/0
[*ASBR2-GigabitEthernet2/0/0] undo shutdown
[*ASBR2-GigabitEthernet2/0/0] ip address 10.20.1.1 24
[*ASBR2-GigabitEthernet2/0/0] quit
[*ASBR2] commit

# 配置PE2。

<HUAWEI> system-view
[~HUAWEI] sysname PE2
[*HUAWEI] commit
[~PE2] interface loopback1
[*PE2-Loopback1] ip address 4.4.4.4 32
[*PE2-Loopback1] quit
[*PE2] interface gigabitethernet 1/0/0
[*PE2-GigabitEthernet1/0/0] undo shutdown
[*PE2-GigabitEthernet1/0/0] ip address 10.20.1.2 24
[*PE2-GigabitEthernet1/0/0] quit
[*PE2] interface gigabitethernet 2/0/0
[*PE2-GigabitEthernet2/0/0] undo shutdown
[*PE2-GigabitEthernet2/0/0] quit
[*PE2] interface gigabitethernet 2/0/0.1
[*PE2-GigabitEthernet2/0/0.1] quit
[*PE2] commit

# 配置CE2。

<HUAWEI> system-view
[~HUAWEI] sysname CE2
[~HUAWEI] commit
[~CE2] interface gigabitethernet 1/0/0
[*CE2-GigabitEthernet1/0/0] undo shutdown
[*CE2-GigabitEthernet1/0/0] quit
[*CE2] interface gigabitethernet 1/0/0.1
[*CE2-GigabitEthernet1/0/0.1] ip address 10.1.1.2 24
[*CE2-GigabitEthernet1/0/0.1] quit
[*CE2] commit

2.配置骨干网的IGP协议

# 配置PE1。

[~PE1] ospf 1
[*PE1-ospf-1] area 0.0.0.0
[*PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[*PE1-ospf-1-area-0.0.0.0] network 10.10.1.0 0.0.0.255 
[*PE1-ospf-1-area-0.0.0.0] quit
[*PE1-ospf-1] quit
[*PE1] commit

# 配置ASBR1。

[~ASBR1] ospf 1
[*ASBR1-ospf-1] area 0.0.0.0
[*ASBR1-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[*ASBR1-ospf-1-area-0.0.0.0] network 10.10.1.0 0.0.0.255
[*ASBR1-ospf-1-area-0.0.0.0] quit
[*ASBR1-ospf-1] quit
[*ASBR1] commit

# 配置ASBR2。

[~ASBR2] ospf 1
[*ASBR2-ospf-1] area 0.0.0.0
[*ASBR2-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[*ASBR2-ospf-1-area-0.0.0.0] network 10.20.1.0 0.0.0.255
[*ASBR2-ospf-1-area-0.0.0.0] quit
[*ASBR2-ospf-1] quit
[*ASBR2] commit

# 配置PE2。

[~PE2] ospf 1
[*PE2-ospf-1] area 0.0.0.0
[*PE2-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0
[*PE2-ospf-1-area-0.0.0.0] network 10.20.1.0 0.0.0.255
[*PE2-ospf-1-area-0.0.0.0] quit
[*PE2-ospf-1] quit
[*PE2] commit

3.使能MPLS,建立LSP隧道

# 配置PE1。

[~PE1] mpls lsr-id 1.1.1.1
[*PE1] mpls
[*PE1-mpls] quit
[*PE1] mpls ldp
[*PE1-mpls-ldp] quit
[*PE1] interface gigabitethernet 2/0/0
[*PE1-GigabitEthernet2/0/0] mpls
[*PE1-GigabitEthernet2/0/0] mpls ldp
[*PE1-GigabitEthernet2/0/0] quit
[*PE1] commit

# 配置ASBR1。

[~ASBR1] mpls lsr-id 2.2.2.2
[*ASBR1] mpls
[*ASBR1-mpls] quit
[*ASBR1] mpls ldp
[*ASBR1-mpls-ldp] quit
[*ASBR1] interface gigabitethernet 1/0/0
[*ASBR1-GigabitEthernet1/0/0] mpls
[*ASBR1-GigabitEthernet1/0/0] mpls ldp
[*ASBR1-GigabitEthernet1/0/0] quit
[*ASBR1] commit

# 配置ASBR2。

[~ASBR2] mpls lsr-id 3.3.3.3
[*ASBR2] mpls
[*ASBR2-mpls] quit
[*ASBR2] mpls ldp
[*ASBR2-mpls-ldp] quit
[*ASBR2] interface gigabitethernet 2/0/0
[*ASBR2-GigabitEthernet2/0/0] mpls
[*ASBR2-GigabitEthernet2/0/0] mpls ldp
[*ASBR2-GigabitEthernet2/0/0] quit
[*ASBR2] commit

# 配置PE2。

[~PE2] mpls lsr-id 4.4.4.4
[*PE2] mpls
[*PE2-mpls] quit
[*PE2] mpls ldp
[*PE2-mpls-ldp] quit
[*PE2] interface gigabitethernet 1/0/0
[*PE2-GigabitEthernet1/0/0] mpls
[*PE2-GigabitEthernet1/0/0] mpls ldp
[*PE2-GigabitEthernet1/0/0] quit
[*PE2] commit

4.配置域内的MP-IBGP连接

# 配置PE1。

[~PE1] bgp 100
[*PE1-bgp] peer 2.2.2.2 as-number 100
[*PE1-bgp] peer 2.2.2.2 connect-interface loopback 1
[*PE1-bgp] l2vpn-ad-family
[*PE1-bgp-af-l2vpn-ad] peer 2.2.2.2 enable
[*PE1-bgp-af-l2vpn-ad] peer 2.2.2.2 signaling vpls
[*PE1-bgp-af-l2vpn-ad] quit
[*PE1-bgp] quit
[*PE1] commit

# 配置ASBR1。

[~ASBR1] bgp 100
[*ASBR1-bgp] peer 1.1.1.1 as-number 100
[*ASBR1-bgp] peer 1.1.1.1 connect-interface loopback 1
[*ASBR1-bgp] l2vpn-ad-family
[*ASBR1-bgp-af-l2vpn-ad] peer 1.1.1.1 enable
[*ASBR1-bgp-af-l2vpn-ad] peer 1.1.1.1 signaling vpls
[*ASBR1-bgp-af-l2vpn-ad] quit
[*ASBR1-bgp] quit
[*ASBR1] commit

# 配置ASBR2。

[~ASBR2] bgp 200
[*ASBR2-bgp] peer 4.4.4.4 as-number 200
[*ASBR2-bgp] peer 4.4.4.4 connect-interface loopback 1
[*ASBR2-bgp] l2vpn-ad-family
[*ASBR2-bgp-af-l2vpn-ad] peer 4.4.4.4 enable
[*ASBR2-bgp-af-l2vpn-ad] peer 4.4.4.4 signaling vpls
[*ASBR2-bgp-af-l2vpn-ad] quit
[*ASBR2-bgp] quit
[*ASBR2] commit

# 配置PE2。

[~PE2] bgp 200
[*PE2-bgp] peer 3.3.3.3 as-number 200
[*PE2-bgp] peer 3.3.3.3 connect-interface loopback 1
[*PE2-bgp] l2vpn-ad-family
[*PE2-bgp-af-l2vpn-ad] peer 3.3.3.3 enable
[*PE2-bgp-af-l2vpn-ad] peer 3.3.3.3 signaling vpls
[*PE2-bgp-af-l2vpn-ad] quit
[*PE2-bgp] quit
[*PE2] commit

完成此步骤后,在PE或ASBR上执行display bgp l2vpn-ad peer命令,可看到MP-IBGP对等体连接状态为“Established”。

以PE1的显示为例:

[~PE1] display bgp l2vpn-ad peer
 BGP local router ID : 1.1.1.1
 Local AS number : 100
 Total number of peers : 1                 Peers in established state : 1
  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down         State PrefRcv
  2.2.2.2         4         100        4        8     0 00:02:05 Established       0

5.配置BGP方式VPLS

# 配置PE1。

[~PE1] mpls l2vpn
[*PE1-l2vpn] quit
[*PE1] vsi v1 auto
[*PE1-vsi-v1] pwsignal bgp
[*PE1-vsi-v1-bgp] route-distinguisher 100:1
[*PE1-vsi-v1-bgp] vpn-target 1:1 import-extcommunity
[*PE1-vsi-v1-bgp] vpn-target 1:1 export-extcommunity
[*PE1-vsi-v1-bgp] site 1 range 5 default-offset 0
[*PE1-vsi-v1-bgp] quit
[*PE1-vsi-v1] quit
[*PE1] interface gigabitethernet1/0/0.1
[*PE1-GigabitEthernet1/0/0.1] shutdown
[*PE1-GigabitEthernet1/0/0.1] vlan-type dot1q 10
[*PE1-GigabitEthernet1/0/0.1] l2 binding vsi v1
[*PE1-GigabitEthernet1/0/0.1] undo shutdown
[*PE1-GigabitEthernet1/0/0.1] quit
[*PE1] commit

# 配置ASBR1。

[~ASBR1] mpls l2vpn
[*ASBR1-l2vpn] quit
[*ASBR1] vsi v1 auto
[*ASBR1-vsi-v1] pwsignal bgp
[*ASBR1-vsi-v1-bgp] route-distinguisher 100:2
[*ASBR1-vsi-v1-bgp] vpn-target 1:1 import-extcommunity
[*ASBR1-vsi-v1-bgp] vpn-target 1:1 export-extcommunity
[*ASBR1-vsi-v1-bgp] site 2 range 5 default-offset 0
[*ASBR1-vsi-v1-bgp] quit
[*ASBR1-vsi-v1] quit
[*ASBR1] interface gigabitethernet2/0/0.1
[*ASBR1-GigabitEthernet2/0/0.1] shutdown
[*ASBR1-GigabitEthernet2/0/0.1] vlan-type dot1q 10
[*ASBR1-GigabitEthernet2/0/0.1] l2 binding vsi v1
[*ASBR1-GigabitEthernet2/0/0.1] undo shudown
[*ASBR1-GigabitEthernet2/0/0.1] quit
[*ASBR1] commit

# 配置ASBR2。

[~ASBR2] mpls l2vpn
[*ASBR2-l2vpn] quit
[*ASBR2] vsi v1 auto
[*ASBR2-vsi-v1] pwsignal bgp
[*ASBR2-vsi-v1-bgp] route-distinguisher 200:1
[*ASBR2-vsi-v1-bgp] vpn-target 1:1 import-extcommunity
[*ASBR2-vsi-v1-bgp] vpn-target 1:1 export-extcommunity
[*ASBR2-vsi-v1-bgp] site 1 range 5 default-offset 0
[*ASBR2-vsi-v1-bgp] quit
[*ASBR2-vsi-v1] quit
[*ASBR2] interface gigabitethernet1/0/0.1
[*ASBR2-GigabitEthernet1/0/0.1] shutdown
[*ASBR2-GigabitEthernet1/0/0.1] vlan-type dot1q 10
[*ASBR2-GigabitEthernet1/0/0.1] l2 binding vsi v1
[*ASBR2-GigabitEthernet1/0/0.1] undo shutdown
[*ASBR2-GigabitEthernet1/0/0.1] quit
[*ASBR2] commit

# 配置PE2。

[~PE2] mpls l2vpn
[*PE2-l2vpn] quit
[*PE2] vsi v1 auto
[*PE2-vsi-v1] pwsignal bgp
[*PE2-vsi-v1-bgp] route-distinguisher 200:2
[*PE2-vsi-v1-bgp] vpn-target 1:1 import-extcommunity
[*PE2-vsi-v1-bgp] vpn-target 1:1 export-extcommunity
[*PE2-vsi-v1-bgp] site 2 range 5 default-offset 0
[*PE2-vsi-v1-bgp] quit
[*PE2-vsi-v1] quit
[*PE2] interface gigabitethernet2/0/0.1
[*PE2-GigabitEthernet2/0/0.1] shutdown
[*PE2-GigabitEthernet2/0/0.1] vlan-type dot1q 10
[*PE2-GigabitEthernet2/0/0.1] l2 binding vsi v1
[*PE2-GigabitEthernet2/0/0.1] undo shutdown
[*PE2-GigabitEthernet2/0/0.1] quit
[*PE2] commit

6.配置CE允许VLAN 10的报文通过

# 配置CE1。

[~CE1] interface gigabitethernet1/0/0.1
[*CE1-GigabitEthernet1/0/0.1] vlan-type dot1q 10
[*CE1-GigabitEthernet1/0/0.1] quit
[*CE1] commit

# 配置CE2。

[~CE2] interface gigabitethernet1/0/0.1
[*CE2-GigabitEthernet1/0/0.1] vlan-type dot1q 10
[*CE2-GigabitEthernet1/0/0.1] quit
[*CE2] commit

7.检验配置结果

在PE上执行display vpls connection bgp verbose命令查看VSI信息,可发现VSI状态为Up。

以PE1的显示为例:

[~PE1] display vpls connection bgp verbose
VSI Name: v1                               Signaling: bgp
  **Remote Site ID     : 2
    VC State           : up
    RD                 : 100:2
    Encapsulation      : bgp vpls
    MTU                : 1500
    Peer Ip Address    : 2.2.2.2
    PW Type            : label
    Local VC Label     : 25602
    Remote VC Label    : 25601
    Tunnel Policy      : --
    Tunnel ID          : 0x2002000
    Remote Label Block : 25600/5/0
    Export vpn target  : 1:1   

CE1与CE2可以相互ping通。

[~CE1] ping 10.1.1.2
  PING 10.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=90 ms
    Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=77 ms
    Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=34 ms
    Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=46 ms
    Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=94 ms
  --- 10.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 34/68/94 ms

在PE或ASBR上执行命令display bgp l2vpn-ad routing-table vpls route-distinguisher site-id label-offset,可以查看指定前缀的VPLS路由信息。以PE1的显示为例:

[~PE1] display bgp l2vpn-ad routing-table vpls route-distinguisher 100:1 site-id 1 label-offset 0
 BGP local router ID : 192.168.0.2
 Local AS number : 100
 Paths:   1 available, 1 best, 1 select
 BGP routing table entry information of 100:1/1/0 :
 Imported route.
 From: 0.0.0.0 (0.0.0.0)
 Route Duration: 00h10m31s
 Direct Out-interface:
 Original nexthop: 0.0.0.0
 Qos information : 0x0
 Ext-Community:RT <1 : 1>, Layer2 Info <Encaps Type: 19, Control Flags: 0, Layer-2 MTU: 1500, VPLS Preference: 0>
 LabelBase(Received/Applied): NULL/294928, Range: 8
 AS-path Nil, origin incomplete, pref-val 0, valid, local, best, select, pre 255
 Advertised to such 1 peers:
    2.2.2.2

以上是关于华为运营商级路由器配置示例 | 配置OptionA方式跨域BGP VPLS示例的主要内容,如果未能解决你的问题,请参考以下文章

华为运营商级路由器配置示例 | 配置OptionA方式跨域BGP AD VPLS示例

华为运营商级路由器配置示例 | 合集

华为运营商级路由器配置示例 | 配置动态VPWS接入VPLS示例

华为运营商级路由器配置示例 | 配置静态方式VPLS示例

华为运营商级路由器配置示例 | 配置LDP方式的HVPLS示例

华为运营商级路由器配置示例 | 配置BGP方式VPLS示例