MPLS VPN场景实际案例分享

本次通过华为ENSP模拟器为大家分享的是MPLS VPN的真实案例

组网需求:

拓扑结构如下:

1.CE1连接公司总部研发区、CE2连接分支机构研发区,CE1和CE2属于vpna;

2,CE3连接公司总部非研发区、CE4连接分支机构非研发区,CE3和CE4属于vpnb;

3.总部和分支机构的研发区和非研发区之间存在地址空间重叠;

4.企业希望在不改变网络部署的情况下,实现总部和分支机构间的安全互访、研发区和非研发区部间的隔离。

解决方案:

采用如下的思路配置BGP/MPLS IP VPN:

1.P、PE之间配置OSPF,实现骨干网的IP连通性。

2.PE、P上配置MPLS基本能力和MPLS LDP,建立MPLS LSP公网隧道,传输VPN数据。

3.PE1和PE2之间配置MP-IBGP,交换VPN路由信息。

4.在PE1和PE2上配置VPN实例,其中,vpna使用的VPN-target属性为100:100,vpnb使用的VPN-target属性为200:200,以实现相同VPN间互通,不同VPN间隔离。同时,与CE相连的接口和相应的VPN实例绑定,以接入VPN用户。

5.CE与PE之间配置静态路由,交换VPN路由信息。

配置过程:

1. 在MPLS骨干网上配置OSPF协议,实现骨干网PE和P的互通

配置PE1:

  1. #
  2. interface GigabitEthernet0/0/2
  3.  ip address 100.1.1.1 255.255.255.252
  4. #
  5. interface LoopBack0
  6.  ip address 1.1.1.1 255.255.255.255
  7. #
  8. ospf 100 router-id 1.1.1.1
  9.  area 0.0.0.0
  10.   network 1.1.1.1 0.0.0.0
  11.   network 100.1.1.0 0.0.0.3
  12. #
  13. 配置P:
  14. #
  15. interface GigabitEthernet0/0/0
  16.  ip address 100.1.1.2 255.255.255.252
  17. #
  18. interface GigabitEthernet0/0/1
  19.  ip address 101.1.1.1 255.255.255.252
  20. #
  21. interface LoopBack0
  22.  ip address 2.2.2.2 255.255.255.255
  23. #
  24. ospf 100 router-id 2.2.2.2
  25.  area 0.0.0.0
  26.   network 2.2.2.2 0.0.0.0
  27.   network 100.1.1.0 0.0.0.3
  28.   network 101.1.1.0 0.0.0.3
  29. #
  30. 配置PE2:
  31. #
  32. interface GigabitEthernet0/0/0
  33.  ip address 101.1.1.2 255.255.255.252
  34. #
  35. interface LoopBack0
  36.  ip address 3.3.3.3 255.255.255.255
  37. #
  38. ospf 100 router-id 3.3.3.3
  39.  area 0.0.0.0
  40.   network 3.3.3.3 0.0.0.0
  41.   network 101.1.1.0 0.0.0.3
  42. #

2.在MPLS骨干网上配置MPLS基本能力和MPLS LDP,建立LDP LSP

  1. 配置PE1:
  2. #
  3. mpls lsr-id 1.1.1.1   //配置LSR的ID
  4. mpls
  5. #
  6. mpls ldp
  7. #
  8. interface GigabitEthernet0/0/2
  9.  mpls
  10.  mpls ldp
  11. #
  12. 配置P:
  13. #
  14. mpls lsr-id 2.2.2.2
  15. mpls
  16. #
  17. mpls ldp
  18. #
  19. interface GigabitEthernet0/0/0
  20. mpls
  21.  mpls ldp
  22. #
  23. interface GigabitEthernet0/0/1
  24. mpls
  25.  mpls ldp
  26. #
  27. 配置PE2:
  28. #
  29. mpls lsr-id 3.3.3.3
  30. mpls
  31. #
  32. mpls ldp
  33. #
  34. interface GigabitEthernet0/0/0
  35. mpls
  36.  mpls ldp
  37. #

3. 在PE设备上配置VPN实例,将CE接入PE

  1. 配置PE1:
  2. #
  3. ip vpn-instance vpna
  4.  ipv4-family
  5.   route-distinguisher 100:100
  6.   vpn-target 100:100 export-extcommunity
  7.   vpn-target 100:100 import-extcommunity
  8. #
  9. ip vpn-instance vpnb
  10.  ipv4-family
  11.   route-distinguisher 200:200
  12.   vpn-target 200:200 export-extcommunity
  13.   vpn-target 200:200 import-extcommunity
  14. #
  15. #
  16. interface GigabitEthernet0/0/0
  17.  ip binding vpn-instance vpna
  18.  ip address 192.168.1.1 255.255.255.0
  19. #
  20. interface GigabitEthernet0/0/1
  21.  ip binding vpn-instance vpnb
  22.  ip address 192.168.1.1 255.255.255.0
  23. #
  24. 配置PE2:
  25. #
  26. ip vpn-instance vpna
  27.  ipv4-family
  28.   route-distinguisher 100:100
  29.   vpn-target 100:100 export-extcommunity
  30.   vpn-target 100:100 import-extcommunity
  31. #
  32. ip vpn-instance vpnb
  33.  ipv4-family
  34.   route-distinguisher 200:200
  35.   vpn-target 200:200 export-extcommunity
  36.   vpn-target 200:200 import-extcommunity
  37. #
  38. #
  39. interface GigabitEthernet0/0/1
  40.  ip binding vpn-instance vpna
  41.  ip address 172.16.1.1 255.255.255.0
  42. #
  43. interface GigabitEthernet0/0/2
  44.  ip binding vpn-instance vpnb
  45.  ip address 172.16.1.1 255.255.255.0
  46. #

4.在PE之间建立MP-IBGP对等体关系

  1. 配置PE1:
  2. #
  3. bgp 100
  4.  peer 3.3.3.3 as-number 100
  5.  peer 3.3.3.3 connect-interface LoopBack0
  6.  #
  7.  ipv4-family unicast
  8.   undo synchronization
  9.   peer 3.3.3.3 enable
  10.  #
  11.  ipv4-family vpnv4
  12.   policy vpn-target
  13.   peer 3.3.3.3 enable
  14.  #
  15.  ipv4-family vpn-instance vpna
  16.   import-route direct
  17.   import-route static
  18.  #
  19.  ipv4-family vpn-instance vpnb
  20.   import-route direct
  21.   import-route static
  22. #
  23. 配置PE2:
  24. #
  25. bgp 100
  26.  peer 1.1.1.1 as-number 100
  27.  peer 1.1.1.1 connect-interface LoopBack0
  28.  #
  29.  ipv4-family unicast
  30.   undo synchronization
  31.   peer 1.1.1.1 enable
  32.  #
  33.  ipv4-family vpnv4
  34.   policy vpn-target
  35. peer 1.1.1.1 enable
  36.  #
  37.  ipv4-family vpn-instance vpna
  38.   import-route direct
  39.   import-route static
  40.  #
  41.  ipv4-family vpn-instance vpnb
  42.   import-route direct
  43.   import-route static
  44. #

5.在CE1、CE2、CE3、CE4设备上配置到各自连接PE的静态路由

#

ip route-static 0.0.0.0 0.0.0.0 192.168.1.1

#

6.配置检查

在PE上检查路由信息是否齐全

<PE1>display ip routing-table

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Tables: Public

         Destinations : 11       Routes : 11      

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0

        2.2.2.2/32  OSPF    10   1           D   100.1.1.2       GigabitEthernet

0/0/2

        3.3.3.3/32  OSPF    10   2           D   100.1.1.2       GigabitEthernet

0/0/2

      100.1.1.0/30  Direct  0    0           D   100.1.1.1       GigabitEthernet

0/0/2

      100.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/2

      100.1.1.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/2

      101.1.1.0/30  OSPF    10   2           D   100.1.1.2       GigabitEthernet

0/0/2

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0

      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

<PE1>display ip routing-table vpn-instance vpna

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Tables: vpna

         Destinations : 5        Routes : 5       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.0/24  IBGP    255  0          RD   3.3.3.3         GigabitEthernet

0/0/2

    192.168.1.0/24  Direct  0    0           D   192.168.1.1     GigabitEthernet

0/0/0

    192.168.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/0

  192.168.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

0/0/0

255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

检查LDP会话建立是否成功:

<PE1>display mpls ldp session

 LDP Session(s) in Public Network

 Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)

 A '*' before a session means the session is being deleted.

 ------------------------------------------------------------------------------

 PeerID             Status      LAM  SsnRole  SsnAge      KASent/Rcv

 ------------------------------------------------------------------------------

 2.2.2.2:0          Operational DU   Passive  0000:01:07  271/271

 ------------------------------------------------------------------------------

 TOTAL: 1 session(s) Found.

检查LDP LSP的建立情况:

<PE1>display mpls ldp lsp

 LDP LSP Information

 --------------------------------------------------------------------

 DestAddress/Mask   In/OutLabel    UpstreamPeer    NextHop         OutInterface

 --------------------------------------------------------------------

 1.1.1.1/32         3/NULL         2.2.2.2         127.0.0.1       InLoop0

*1.1.1.1/32         Liberal/1024                   DS/2.2.2.2

 2.2.2.2/32         NULL/3         -               100.1.1.2       GE0/0/2

 2.2.2.2/32         1024/3         2.2.2.2         100.1.1.2       GE0/0/2

 3.3.3.3/32         NULL/1025      -               100.1.1.2       GE0/0/2

 3.3.3.3/32         1025/1025      2.2.2.2         100.1.1.2       GE0/0/2

 --------------------------------------------------------------------

检查PE之间的BGP对等体关系是否建立:

<PE1>display bgp peer

 BGP local router ID : 100.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 Pre

fRcv

  3.3.3.3         4         100       74       75     0 01:10:55 Established    

   0

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值