龙空技术网

HCIE2020__路由交换专家__配置 跨域VPN Option-C方案二

剪自在 161

前言:

眼前大家对“跨域怎么配置路由器”大概比较关切,同学们都需要学习一些“跨域怎么配置路由器”的相关内容。那么小编同时在网摘上网罗了一些有关“跨域怎么配置路由器””的相关资讯,希望小伙伴们能喜欢,各位老铁们快快来学习一下吧!

1.1.1 关于本实验

本实验主要介绍了跨域VPN Option-C方案二的配置方法。

1.1.2 实验目的

掌握Option-C方案二原理,掌握其配置思路和方法。

1.1.3 实验组网介绍

图1-1 跨域VPN Option-C方案二配置实验拓扑图

1.1.4 实验规划

如上图所示,共分为4个AS,PE1、RR1、P1和ASBR1属于AS100,PE2、RR2、P2和ASBR2属于AS200。CE1和CE2属于同一个VPN,CE1通过AS100的PE1接入,CE2通过AS200的PE2接入,每台路由器的IP地址规划详见拓扑图。

1.2 实验任务配置1.2.1 配置思路配置各接口IP。配置OSPF。配置MPLS/MPLS LDP。在ASBR1与ASBR2之间配置EBGP。ASBR通告RR的Loopback接口,引入到IGP。在PE上配置VPN实例,接口绑定VPN。在PE的VPN实例中配置与CE的EBGP。配置PE与RR, RR与RR之间的MP-BGP。配置ASBR交换标签IPv4路由能力。配置ASBR MPLS触发建立BGP标签路由LSP能力。配置ASBR发布路由应用路由策略。1.2.2 配置步骤

步骤 1 配置各接口IP地址

#配置CE1。

<Huawei>system-view[Huawei]sysname CE1[CE1]interface GigabitEthernet0/0/1[CE1-GigabitEthernet0/0/1]ip address 10.1.1.1 30 [CE1-GigabitEthernet0/0/1]undo shutdown[CE1-GigabitEthernet0/0/1]quit[CE1]interface LoopBack 0[CE1-LoopBack0]ip address 11.11.11.11 32

#配置PE1。

<Huawei>system-view[Huawei]sysname PE1[PE1]interface GigabitEthernet0/0/0[PE1-GigabitEthernet0/0/0]ip address 12.12.12.1 30[PE1-GigabitEthernet0/0/0]undo shutdown[PE1-GigabitEthernet0/0/0]quit[PE1]interface loopback 0[PE1-LoopBack0]ip address 1.1.1.1 32[PE1-LoopBack0]quit

#配置P1。

<Huawei>system-view[Huawei]sysname P1[P1]interface GigabitEthernet0/0/0[P1-GigabitEthernet0/0/0]ip address 12.12.12.2 30[P1-GigabitEthernet0/0/0]undo shutdown[P1-GigabitEthernet0/0/0]quit[P1]interface GigabitEthernet0/0/1[P1-GigabitEthernet0/0/1]ip address 23.23.23.1 30[P1-GigabitEthernet0/0/1]undo shutdown[P1-GigabitEthernet0/0/1]quit[P1]interface GigabitEthernet0/0/2[P1-GigabitEthernet0/0/2]ip address 72.72.72.2 30[P1-GigabitEthernet0/0/2]undo shutdown[P1-GigabitEthernet0/0/2]quit[P1]interface loopback 0[P1-LoopBack0]ip address 2.2.2.2 32[P1-LoopBack0]quit

#配置RR1。

<Huawei>system-view[Huawei]sysname RR1[RR1]interface GigabitEthernet0/0/2[RR1-GigabitEthernet0/0/2]ip address 72.72.72.1 30 [RR1-GigabitEthernet0/0/2]undo shutdown[RR1-GigabitEthernet0/0/2]quit[RR1]interface LoopBack 0[RR1-LoopBack0]ip address 7.7.7.7 32

# 配置ASBR1。

<Huawei>system-view[Huawei]sysname ASBR1[ASBR1]interface GigabitEthernet0/0/0[ASBR1-GigabitEthernet0/0/0]ip address 34.34.34.1 30[ASBR1-GigabitEthernet0/0/0]undo shutdown[ASBR1-GigabitEthernet0/0/0]quit[ASBR1]interface GigabitEthernet0/0/1[ASBR1-GigabitEthernet0/0/1]ip address 23.23.23.2 30[ASBR1-GigabitEthernet0/0/1]undo shutdown[ASBR1-GigabitEthernet0/0/1]quit[ASBR1]interface loopback 0[ASBR1-LoopBack0]ip address 3.3.3.3 32[ASBR1-LoopBack0]quit

# 配置ASBR2。

<Huawei>system-view[Huawei]sysname ASBR2[ASBR2]interface GigabitEthernet0/0/0[ASBR2-GigabitEthernet0/0/0]ip address 34.34.34.2 30[ASBR2-GigabitEthernet0/0/0]undo shutdown[ASBR2-GigabitEthernet0/0/0]quit[ASBR2]interface GigabitEthernet0/0/1[ASBR2-GigabitEthernet0/0/1]ip address 45.45.45.1 30[ASBR2-GigabitEthernet0/0/1]undo shutdown[ASBR2-GigabitEthernet0/0/1]quit[ASBR2]interface loopback 0[ASBR2-LoopBack0]ip address 4.4.4.4 32[ASBR2-LoopBack0]quit

#配置P2。

<Huawei>system-view[Huawei]sysname P2[P2]interface GigabitEthernet0/0/0[P2-GigabitEthernet0/0/0]ip address 56.56.56.1 30[P2-GigabitEthernet0/0/0]undo shutdown[P2-GigabitEthernet0/0/0]quit[P2]interface GigabitEthernet0/0/1[P2-GigabitEthernet0/0/1]ip address 45.45.45.2 30[P2-GigabitEthernet0/0/1]undo shutdown[P2-GigabitEthernet0/0/1]quit[P2]interface GigabitEthernet0/0/2[P2-GigabitEthernet0/0/2]ip address 58.58.58.1 30[P2-GigabitEthernet0/0/2]undo shutdown[P2-GigabitEthernet0/0/2]quit[P2]interface loopback 0[P2-LoopBack0]ip address 5.5.5.5 32[P2-LoopBack0]quit

#配置PE2。

<Huawei>system-view[Huawei]sysname PE2[PE2]interface GigabitEthernet0/0/0[PE2-GigabitEthernet0/0/0]ip address 56.56.56.2 30[PE2-GigabitEthernet0/0/0]undo shutdown[PE2-GigabitEthernet0/0/0]quit[PE2]interface loopback 0[PE2-LoopBack0]ip address 6.6.6.6 32[PE2-LoopBack0]quit

#配置RR2。

<Huawei>system-view[Huawei]sysname RR2[RR2]interface GigabitEthernet0/0/2[RR2-GigabitEthernet0/0/2]ip address 58.58.58.2 30[RR2-GigabitEthernet0/0/2]undo shutdown[RR2-GigabitEthernet0/0/2]quit[RR2]interface loopback 0[RR2-LoopBack0]ip address 8.8.8.8 32

#配置CE2。

<Huawei>system-view[Huawei]sysname CE2[CE2]interface GigabitEthernet0/0/1[CE2-GigabitEthernet0/0/1]ip address 20.1.1.2 30[CE2-GigabitEthernet0/0/1]undo shutdown[CE2-GigabitEthernet0/0/1]quit[CE2]interface loopback 0[CE2-LoopBack0]ip address 22.22.22.22 32

步骤 2 配置OSPF

#配置PE1。

[PE1]ospf 1 router-id 1.1.1.1[PE1-ospf-1]area 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 12.12.12.0 0.0.0.3

#配置P1。

[P1]ospf 1 router-id 2.2.2.2[P1-ospf-1]area 0[P1-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0[P1-ospf-1-area-0.0.0.0]network 12.12.12.0 0.0.0.3[P1-ospf-1-area-0.0.0.0]network 23.23.23.0 0.0.0.3[P1-ospf-1-area-0.0.0.0]network 72.72.72.0 0.0.0.3

#配置RR1。

[RR1]ospf 1 router-id 7.7.7.7[RR1-ospf-1]area 0[RR1-ospf-1-area-0.0.0.0]network 7.7.7.7 0.0.0.0[RR1-ospf-1-area-0.0.0.0]network 72.72.72.0 0.0.0.3

#配置ASBR1。

[ASBR1]ospf 1 router-id 3.3.3.3[ASBR1-ospf-1]area 0[ASBR1-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0[ASBR1-ospf-1-area-0.0.0.0]network 23.23.23.0 0.0.0.3

#配置ASBR2。

[ASBR2]ospf 1 router-id 4.4.4.4[ASBR2-ospf-1]area 0[ASBR2-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0[ASBR2-ospf-1-area-0.0.0.0]network 45.45.45.0 0.0.0.3

#配置P2。

[P2]ospf 1 router-id 5.5.5.5[P2-ospf-1]area 0[P2-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0[P2-ospf-1-area-0.0.0.0]network 45.45.45.0 0.0.0.3[P2-ospf-1-area-0.0.0.0]network 56.56.56.0 0.0.0.3[P2-ospf-1-area-0.0.0.0]network 58.58.58.0 0.0.0.3

#配置RR2。

[RR2]ospf 1 router-id 8.8.8.8[RR2-ospf-1]area 0[RR2-ospf-1-area-0.0.0.0]network 8.8.8.8 0.0.0.0[RR2-ospf-1-area-0.0.0.0]network 58.58.58.0 0.0.0.3

#配置PE2。

[PE2]ospf 1 router-id 6.6.6.6[PE2-ospf-1]area 0[PE2-ospf-1-area-0.0.0.0]network 6.6.6.6 0.0.0.0[PE2-ospf-1-area-0.0.0.0]network 56.56.56.0 0.0.0.3

步骤 3 使能MPLS/MPLS LDP

#配置PE1。

<PE1>system-view[PE1]mpls lsr-id 1.1.1.1[PE1]mpls[PE1-mpls]mpls ldp[PE1-mpls-ldp]quit[PE1]interface GigabitEthernet0/0/0[PE1-GigabitEthernet0/0/0]mpls[PE1-GigabitEthernet0/0/0]mpls ldp[PE1-GigabitEthernet0/0/0]quit

#配置P1。

<P1>system-view[P1]mpls lsr-id 2.2.2.2[P1]mpls[P1-mpls]mpls ldp[P1-mpls-ldp]quit[P1]interface GigabitEthernet0/0/0[P1-GigabitEthernet0/0/0]mpls[P1-GigabitEthernet0/0/0]mpls ldp[P1-GigabitEthernet0/0/0]quit[P1]interface GigabitEthernet0/0/1[P1-GigabitEthernet0/0/1]mpls[P1-GigabitEthernet0/0/1]mpls ldp[P1-GigabitEthernet0/0/1]quit

#配置ASBR1。

[ASBR1]mpls lsr-id 3.3.3.3[ASBR1]mpls[ASBR1-mpls]mpls ldp[ASBR1-mpls-ldp]quit[ASBR1]interface GigabitEthernet0/0/1[ASBR1-GigabitEthernet0/0/1]mpls[ASBR1-GigabitEthernet0/0/1]mpls ldp[ASBR1-GigabitEthernet0/0/1]quit

#配置ASBR2。

[ASBR2]mpls lsr-id 4.4.4.4[ASBR2]mpls[ASBR2-mpls]mpls ldp[ASBR2-mpls-ldp]quit[ASBR2]interface GigabitEthernet0/0/1[ASBR2-GigabitEthernet0/0/1]mpls[ASBR2-GigabitEthernet0/0/1]mpls ldp[ASBR2-GigabitEthernet0/0/1]quit

#配置P2。

<P2>system-view[P2]mpls lsr-id 5.5.5.5[P2]mpls[P2-mpls]mpls ldp[P2-mpls-ldp]quit[P2]interface GigabitEthernet0/0/0[P2-GigabitEthernet0/0/0]mpls[P2-GigabitEthernet0/0/0]mpls ldp[P2-GigabitEthernet0/0/0]quit[P2]interface GigabitEthernet0/0/1[P2-GigabitEthernet0/0/1]mpls[P2-GigabitEthernet0/0/1]mpls ldp[P2-GigabitEthernet0/0/1]quit

#配置PE2。

[PE2]mpls lsr-id 6.6.6.6[PE2]mpls[PE2-mpls]mpls ldp[PE2-mpls-ldp]quit[PE2]interface GigabitEthernet0/0/0[PE2-GigabitEthernet0/0/0]mpls[PE2-GigabitEthernet0/0/0]mpls ldp[PE2-GigabitEthernet0/0/0]quit

步骤 4 ASBR之间配置EBGP

#配置ASBR1。

[ASBR1]bgp 100[ASBR1-bgp]peer 34.34.34.2 as-number 200

#配置ASBR2。

[ASBR2]bgp 200[ASBR2-bgp]peer 34.34.34.1 as-number 100

步骤 5 ASBR通告RR的Loopback口,引入到IGP

#配置ASBR1。

[ASBR1]bgp 100[ASBR1-bgp]network 7.7.7.7 32[ASBR1]ospf[ASBR1-ospf-1]import-route bgp

#配置ASBR2。

[ASBR2]bgp 200[ASBR2-bgp]network 8.8.8.8 32[ASBR2]ospf[ASBR2-ospf-1]import-route bgp

步骤 6 PE配置VPN实例,接口绑定VPN

#配置PE1。

[PE1]ip vpn-instance huawei[PE1-vpn-instance-huawei]route-distinguisher 100:1[PE1-vpn-instance-huawei]vpn-target 100:1 both[PE1]interface GigabitEthernet0/0/1[PE1-GigabitEthernet0/0/1]ip binding vpn-instance huawei[PE1-GigabitEthernet0/0/1]ip address 10.1.1.2 30[PE1-GigabitEthernet0/0/1]quit

#配置PE2。

[PE2]ip vpn-instance huawei[PE2-vpn-instance-huawei]route-distinguisher 100:1[PE2-vpn-instance-huawei]vpn-target 100:1 both[PE2]interface GigabitEthernet0/0/1[PE2-GigabitEthernet0/0/1]ip binding vpn-instance huawei[PE2-GigabitEthernet0/0/1]ip address 20.1.1.1 30[PE2-GigabitEthernet0/0/1]quit

步骤 7 PE VPN实例中配置与CE的EBGP

#配置PE1。

[PE1]bgp 100[PE1-bgp]ipv4-family vpn-instance huawei[PE1-bgp-huawei]peer 10.1.1.1 as-number 65001

#配置CE1。

[CE1]bgp 65001[CE1-bgp]peer 10.1.1.2 as-number 100[CE1-bgp]network 11.11.11.11 32

#配置PE2。

[PE2]bgp 200[PE2-bgp]ipv4-family vpn-instance huawei[PE2-bgp-huawei]peer 20.1.1.2 as-number 65002

#配置CE2。

[CE2]bgp 65002[CE2-bgp]peer 20.1.1.1 as-number 200[CE2-bgp]network 22.22.22.22 32

步骤 8 配置PE与RR,RR之间的BGP和MP-BGP

#配置PE1。

[PE1]bgp 100[PE1-bgp]peer 7.7.7.7 as-number 100[PE1-bgp]peer 7.7.7.7 connect-interface LoopBack 0[PE1-bgp]ipv4-family vpnv4[PE1-bgp-af-vpnv4]peer 7.7.7.7 enable

#配置RR1。

[RR1]bgp 100[RR1-bgp]peer 1.1.1.1 as-number 100[RR1-bgp]peer 1.1.1.1 connect-interface LoopBack 0[RR1-bgp]peer 8.8.8.8 as-number 200[RR1-bgp]peer 8.8.8.8 connect-interface LoopBack 0[RR1-bgp]peer 8.8.8.8 ebgp-max-hop 10[RR1-bgp]ipv4-family vpnv4[RR1-bgp-af-vpnv4]undo policy vpn-target[RR1-bgp-af-vpnv4]peer  1.1.1.1 enable[RR1-bgp-af-vpnv4]peer  1.1.1.1 reflect-client[RR1-bgp-af-vpnv4]peer  1.1.1.1 next-hop-invariable[RR1-bgp-af-vpnv4]peer  8.8.8.8 enable[RR1-bgp-af-vpnv4]peer  8.8.8.8 next-hop-invariable

#配置RR2。

[RR2]bgp 200[RR2-bgp]peer 6.6.6.6 as-number 200[RR2-bgp]peer 6.6.6.6 connect-interface LoopBack 0[RR2-bgp]peer 7.7.7.7 as-number 100[RR2-bgp]peer 7.7.7.7 connect-interface LoopBack 0[RR2-bgp]peer 7.7.7.7 ebgp-max-hop 10                     [RR2-bgp]ipv4-family vpnv4[RR2-bgp-af-vpnv4]undo policy vpn-target[RR2-bgp-af-vpnv4]peer  6.6.6.6 enable[RR2-bgp-af-vpnv4]peer  6.6.6.6 reflect-client[RR2-bgp-af-vpnv4]peer  6.6.6.6 next-hop-invariable[RR2-bgp-af-vpnv4]peer  7.7.7.7 enable[RR2-bgp-af-vpnv4]peer  7.7.7.7 next-hop-invariable

#配置PE2。

[PE2]bgp 200[PE2-bgp]peer 8.8.8.8 as-number 200[PE2-bgp]peer 8.8.8.8 connect-interface LoopBack 0[PE2-bgp]ipv4-family vpnv4[PE2-bgp-af-vpnv4]peer 8.8.8.8 enable

步骤 9 配置ASBR交换标签IPv4路由能力

#配置ASBR1。

[ASBR1]bgp 100[ASBR1-bgp]peer 34.34.34.2 as-number 200[ASBR1-bgp]peer 34.34.34.2 label-route-capability

#配置ASBR2。

[ASBR2]bgp 200[ASBR2-bgp]peer 34.34.34.1 as-number 100[ASBR2-bgp]peer 34.34.34.1 label-route-capability

步骤 10 配置ASBR MPLS触发建立BGP标签路由LSP能力

#配置ASBR1。

[ASBR1]mpls      [ASBR1-mpls]lsp-trigger bgp-label-route

#配置ASBR2。

[ASBR2]mpls      [ASBR2-mpls]lsp-trigger bgp-label-route

步骤 11 ASBR配置路由策略

#配置ASBR1。

[ASBR1]interface GigabitEthernet0/0/0[ASBR1-GigabitEthernet0/0/0]ip address 34.34.34.1 30[ASBR1-GigabitEthernet0/0/0]mpls[ASBR1-GigabitEthernet0/0/0]quit[ASBR1]route-policy policy1 permit node 10[ASBR1-route-policy]apply mpls-label //为匹配条件的路由分配标签。[ASBR1-route-policy]quit[ASBR1]bgp 100[ASBR1-bgp]peer 34.34.34.2 as-number 200[ASBR1-bgp]peer 34.34.34.2 route-policy policy1 export[ASBR1-bgp]network 1.1.1.1 32

#配置ASBR2。

[ASBR2]interface GigabitEthernet0/0/0[ASBR2-GigabitEthernet0/0/0]ip address 34.34.34.2 30[ASBR2-GigabitEthernet0/0/0]mpls[ASBR2-GigabitEthernet0/0/0]quit[ASBR2]route-policy policy1 permit node 10[ASBR2-route-policy]apply mpls-label //为匹配条件的路由分配标签。[ASBR2-route-policy]quit[ASBR2]bgp 200[ASBR2-bgp]peer 34.34.34.1 as-number 100[ASBR2-bgp]peer 34.34.34.1 route-policy policy1 export[ASBR2-bgp]network 6.6.6.6 32
1.3 结果验证1.3.1 检查配置结果

#在CE1使用命令display ip routing-table查看是否学习到对端CE发来的路由:

[CE1]dis ip routing-tableRoute Flags: R - relay, D - download to fib----------------------------------------------------------------------------------------------------Routing Tables: Public         Destinations : 6        Routes : 6       Destination/Mask Proto   Pre  Cost      Flags NextHop         Interface10.1.1.0/30        Direct      0    0           D   10.1.1.1        GigabitEthernet0/0/110.1.1.1/32        Direct      0    0           D   127.0.0.1       GigabitEthernet0/0/111.11.11.11/32  Direct      0    0           D   127.0.0.1       LoopBack022.22.22.22/32 EBGP    255  0            D   10.1.1.2        GigabitEthernet0/0/1127.0.0.0/8       Direct      0    0           D   127.0.0.1       InLoopBack0127.0.0.1/32       Direct      0    0           D   127.0.0.1       InLoopBack0

#在ASBR上执行display bgp routing-table label命令,可以看到路由的标签信息:

[ASBR1]dis bgp routing-table label BGP Local router ID is 34.34.34.1 Status codes: * - valid, > - best, d - damped,               h - history,  i - internal, s - suppressed, S - Stale               Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 4        Network           NextHop           In/Out Label  *>     1.1.1.1           23.23.23.1        1024/NULL *>     6.6.6.6           34.34.34.2        NULL/1024 *>     7.7.7.7           23.23.23.1        1025/NULL *>     8.8.8.8           34.34.34.2        NULL/1025

#上述配置完成后,CE之间能学习到对方的接口路由,使用命令display ip routing-table以CE1为例:

<CE1>dis ip routing-tableRoute Flags: R - relay, D - download to fib---------------------------------------------------------------------------------------------------Routing Tables: Public         Destinations : 6        Routes : 6        Destination/Mask Proto   Pre  Cost      Flags NextHop         Interface 10.1.1.0/30        Direct     0    0           D   10.1.1.1        GigabitEthernet0/0/110.1.1.1/32        Direct     0    0           D   127.0.0.1       GigabitEthernet0/0/111.11.11.11/32  Direct     0    0           D   127.0.0.1       LoopBack022.22.22.22/32  EBGP     255  0           D   10.1.1.2        GigabitEthernet0/0/1127.0.0.0/8        Direct     0    0           D   127.0.0.1       InLoopBack0127.0.0.1/32       Direct     0    0           D   127.0.0.1       InLoopBack0

#在PE上执行display mpls lsp命令,可以看到去往对方PE的LDP LSP:

[PE1]dis mpls lsp-------------------------------------------------------------------------------------------                 LSP Information: BGP  LSP-------------------------------------------------------------------------------------------FEC                In/Out Label  In/Out IF                      Vrf Name      11.11.11.11/32     1028/NULL     -/-                            huawei        -------------------------------------------------------------------------------------------                 LSP Information: LDP LSP-------------------------------------------------------------------------------------------FEC               In/Out Label  In/Out IF                      Vrf Name      2.2.2.2/32         NULL/3        -/GE0/0/0                                    2.2.2.2/32         1024/3        -/GE0/0/0                                     3.3.3.3/32         NULL/1026     -/GE0/0/0                                     3.3.3.3/32         1025/1026     -/GE0/0/0                                    6.6.6.6/32        NULL/1025     -/GE0/0/0                                    6.6.6.6/32        1026/1025     -/GE0/0/0                                     8.8.8.8/32         NULL/1024     -/GE0/0/0                                    8.8.8.8/32         1027/1024     -/GE0/0/0                                    1.1.1.1/32         3/NULL        -/-                                          
1.4 参考配置1.4.1 CE1的配置
[CE1]dis cur#sysname CE1#interface GigabitEthernet0/0/1 ip address 10.1.1.1 255.255.255.252#interface LoopBack0 ip address 11.11.11.11 255.255.255.255#bgp 65001 peer 10.1.1.2 as-number 100 # ipv4-family unicast  undo synchronization  network 11.11.11.11 255.255.255.255  peer 10.1.1.2 enable#return
1.4.2 PE1的配置
[PE1]dis cur#sysname PE1#ip vpn-instance huawei ipv4-family  route-distinguisher 100:1  vpn-target 100:1 export-extcommunity  vpn-target 100:1 import-extcommunity#mpls lsr-id 1.1.1.1mpls#mpls ldp#interface GigabitEthernet0/0/0 ip address 12.12.12.1 255.255.255.252 mpls mpls ldp#interface GigabitEthernet0/0/1 ip binding vpn-instance huawei ip address 10.1.1.2 255.255.255.252#interface LoopBack0 ip address 1.1.1.1 255.255.255.255#bgp 100 peer 7.7.7.7 as-number 100 peer 7.7.7.7 connect-interface LoopBack0 # ipv4-family unicast  undo synchronization  peer 7.7.7.7 enable # ipv4-family vpnv4  policy vpn-target  peer 7.7.7.7 enable # ipv4-family vpn-instance huawei  peer 10.1.1.1 as-number 65001#ospf 1 router-id 1.1.1.1 area 0.0.0.0  network 1.1.1.1 0.0.0.0  network 12.12.12.0 0.0.0.3#return
1.4.3 P1的配置
[P1]dis cur#sysname P1#mpls lsr-id 2.2.2.2mpls#mpls ldp#interface GigabitEthernet0/0/0 ip address 12.12.12.2 255.255.255.252 mpls mpls ldp#interface GigabitEthernet0/0/1 ip address 23.23.23.1 255.255.255.252 mpls mpls ldp#interface GigabitEthernet0/0/2 ip address 72.72.72.2 255.255.255.252#interface LoopBack0 ip address 2.2.2.2 255.255.255.255#ospf 1 router-id 2.2.2.2 area 0.0.0.0  network 2.2.2.2 0.0.0.0  network 12.12.12.0 0.0.0.3  network 23.23.23.0 0.0.0.3  network 72.72.72.0 0.0.0.3#return
1.4.4 ASBR1的配置
[ASBR1]dis cur#sysname ASBR1#mpls lsr-id 3.3.3.3mpls lsp-trigger bgp-label-route#mpls ldp#interface GigabitEthernet0/0/0 ip address 34.34.34.1 255.255.255.252 mpls#interface GigabitEthernet0/0/1 ip address 23.23.23.2 255.255.255.252 mpls mpls ldp#interface LoopBack0 ip address 3.3.3.3 255.255.255.255#bgp 100 peer 34.34.34.2 as-number 200 # ipv4-family unicast  undo synchronization  network 1.1.1.1 255.255.255.255  network 7.7.7.7 255.255.255.255  peer 34.34.34.2 enable  peer 34.34.34.2 route-policy policy1 export  peer 34.34.34.2 label-route-capability#ospf 1 router-id 3.3.3.3 import-route bgp area 0.0.0.0  network 3.3.3.3 0.0.0.0  network 23.23.23.0 0.0.0.3#route-policy policy1 permit node 10 apply mpls-label#return
1.4.5 RR1的配置
[RR1]dis cur#sysname RR1#interface GigabitEthernet0/0/2 ip address 72.72.72.1 255.255.255.252#interface LoopBack0 ip address 7.7.7.7 255.255.255.255#bgp 100 peer 1.1.1.1 as-number 100 peer 1.1.1.1 connect-interface LoopBack0 peer 8.8.8.8 as-number 200 peer 8.8.8.8 ebgp-max-hop 10 peer 8.8.8.8 connect-interface LoopBack0 # ipv4-family unicast  undo synchronization  peer 1.1.1.1 enable  peer 8.8.8.8 enable # ipv4-family vpnv4  undo policy vpn-target  peer 1.1.1.1 enable  peer 1.1.1.1 reflect-client  peer 1.1.1.1 next-hop-invariable  peer 8.8.8.8 enable  peer 8.8.8.8 next-hop-invariable#ospf 1 router-id 7.7.7.7 area 0.0.0.0  network 7.7.7.7 0.0.0.0  network 72.72.72.0 0.0.0.3#return
1.4.6 ASBR2的配置
[ASBR2]dis cur#sysname ASBR2#mpls lsr-id 4.4.4.4mpls lsp-trigger bgp-label-route#mpls ldp#interface GigabitEthernet0/0/0 ip address 34.34.34.2 255.255.255.252 mpls#interface GigabitEthernet0/0/1 ip address 45.45.45.1 255.255.255.252 mpls mpls ldp#interface LoopBack0 ip address 4.4.4.4 255.255.255.255#bgp 200 peer 34.34.34.1 as-number 100 # ipv4-family unicast  undo synchronization  network 6.6.6.6 255.255.255.255  network 8.8.8.8 255.255.255.255  peer 34.34.34.1 enable  peer 34.34.34.1 route-policy policy1 export  peer 34.34.34.1 label-route-capability#ospf 1 router-id 4.4.4.4 import-route bgp area 0.0.0.0  network 4.4.4.4 0.0.0.0  network 45.45.45.0 0.0.0.3#route-policy policy1 permit node 10 apply mpls-label#return
1.4.7 P2的配置
[P2]dis cur#sysname P2#mpls lsr-id 5.5.5.5mpls lsp-trigger bgp-label-route#mpls ldp#interface GigabitEthernet0/0/0 ip address 56.56.56.1 255.255.255.252 mpls mpls ldp#interface GigabitEthernet0/0/1 ip address 45.45.45.2 255.255.255.252 mpls mpls ldp#interface GigabitEthernet0/0/2 ip address 58.58.58.1 255.255.255.252#interface LoopBack0 ip address 5.5.5.5 255.255.255.255#ospf 1 router-id 5.5.5.5 area 0.0.0.0  network 5.5.5.5 0.0.0.0  network 45.45.45.0 0.0.0.3  network 56.56.56.0 0.0.0.3  network 58.58.58.0 0.0.0.3#return
1.4.8 PE2的配置
[PE2]dis cur#sysname PE2#ip vpn-instance huawei ipv4-family  route-distinguisher 100:1  vpn-target 100:1 export-extcommunity  vpn-target 100:1 import-extcommunity#mpls lsr-id 6.6.6.6mpls#mpls ldp#interface GigabitEthernet0/0/0 ip address 56.56.56.2 255.255.255.252 mpls mpls ldp#interface GigabitEthernet0/0/1 ip binding vpn-instance huawei ip address 20.1.1.1 255.255.255.252#interface LoopBack0 ip address 6.6.6.6 255.255.255.255#bgp 200 peer 8.8.8.8 as-number 200 peer 8.8.8.8 connect-interface LoopBack0 # ipv4-family unicast  undo synchronization  peer 8.8.8.8 enable # ipv4-family vpnv4  policy vpn-target  peer 8.8.8.8 enable # ipv4-family vpn-instance huawei  peer 20.1.1.2 as-number 65002#ospf 1 router-id 6.6.6.6 area 0.0.0.0  network 6.6.6.6 0.0.0.0  network 56.56.56.0 0.0.0.3#return
1.4.9 RR2的配置
[RR2]dis cur#sysname RR2#interface GigabitEthernet0/0/2 ip address 58.58.58.2 255.255.255.252#interface LoopBack0 ip address 8.8.8.8 255.255.255.255#bgp 200 peer 6.6.6.6 as-number 200 peer 6.6.6.6 connect-interface LoopBack0 peer 7.7.7.7 as-number 100 peer 7.7.7.7 ebgp-max-hop 10 peer 7.7.7.7 connect-interface LoopBack0 # ipv4-family unicast  undo synchronization  peer 6.6.6.6 enable  peer 7.7.7.7 enable # ipv4-family vpnv4  undo policy vpn-target  peer 6.6.6.6 enable  peer 6.6.6.6 reflect-client  peer 6.6.6.6 next-hop-invariable  peer 7.7.7.7 enable  peer 7.7.7.7 next-hop-invariable#ospf 1 router-id 8.8.8.8 area 0.0.0.0  network 8.8.8.8 0.0.0.0  network 58.58.58.0 0.0.0.3#return
1.4.10 CE2的配置
[CE2]dis cur#sysname CE2#interface GigabitEthernet0/0/1 ip address 20.1.1.2 255.255.255.252#interface LoopBack0 ip address 22.22.22.22 255.255.255.255#bgp 65002 peer 20.1.1.1 as-number 200 # ipv4-family unicast  undo synchronization  network 22.22.22.22 255.255.255.255  peer 20.1.1.1 enable#return

标签: #跨域怎么配置路由器