当前位置:   article > 正文

MPLS VPN 实验

MPLS VPN 实验

目录

MPLS VPN 实验 

拓扑图

实验目的

基础配置

R2

R3

R4

公网部分配置IGP(ospf)

R2

R3

R4

激活MPLS

R2

R3

R4

VRF创建

R2

R4

将接口画入VRF空间

R2

R4

配置接口IP地址

R2

R4

站点1基本配置

站点2基本配置

通过静态路由在CE和PE上配置

启动BGP

建立MP-BGP邻居

发布站点1信息

发布直连路由以及静态路由

测试​编辑

发布站点2的路由信息

发布路由(neetwork发布)

测试

 连通性测试


MPLS VPN 实验 

拓扑图

实验目的

        站点1与站点2需要通过MPLS VPN搭建到一起         

R2、R4--- PE

R3 --- P

R1、R5 --- CE

基础配置

R2

  1. [R2]display ip interface brief
  2. *down: administratively down
  3. ^down: standby
  4. (l): loopback
  5. (s): spoofing
  6. The number of interface that is UP in Physical is 4
  7. The number of interface that is DOWN in Physical is 1
  8. The number of interface that is UP in Protocol is 3
  9. The number of interface that is DOWN in Protocol is 2
  10. Interface IP Address/Mask Physical Protocol
  11. GigabitEthernet0/0/0 unassigned up down
  12. GigabitEthernet0/0/1 23.0.0.1/24 up up
  13. GigabitEthernet0/0/2 unassigned down down
  14. LoopBack0 2.2.2.2/24 up up(s)
  15. NULL0 unassigned up up(s)
  16. [R2]

R3

  1. [R3]display ip interface brief
  2. *down: administratively down
  3. ^down: standby
  4. (l): loopback
  5. (s): spoofing
  6. The number of interface that is UP in Physical is 4
  7. The number of interface that is DOWN in Physical is 1
  8. The number of interface that is UP in Protocol is 4
  9. The number of interface that is DOWN in Protocol is 1
  10. Interface IP Address/Mask Physical Protocol
  11. GigabitEthernet0/0/0 23.0.0.2/24 up up
  12. GigabitEthernet0/0/1 24.0.0.1/24 up up
  13. GigabitEthernet0/0/2 unassigned down down
  14. LoopBack0 3.3.3.3/24 up up(s)
  15. NULL0 unassigned up up(s)
  16. [R3]

R4

  1. [R4]display ip interface brief
  2. *down: administratively down
  3. ^down: standby
  4. (l): loopback
  5. (s): spoofing
  6. The number of interface that is UP in Physical is 4
  7. The number of interface that is DOWN in Physical is 1
  8. The number of interface that is UP in Protocol is 3
  9. The number of interface that is DOWN in Protocol is 2
  10. Interface IP Address/Mask Physical Protocol
  11. GigabitEthernet0/0/0 34.0.0.2/24 up up
  12. GigabitEthernet0/0/1 unassigned up down
  13. GigabitEthernet0/0/2 unassigned down down
  14. LoopBack0 4.4.4.4/24 up up(s)
  15. NULL0 unassigned up up(s)
  16. [R4]

公网部分配置IGP(ospf)

R2

  1. [R2]ospf router-id 2.2.2.2
  2. [R2-ospf-1]area 0
  3. [R2-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
  4. [R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

R3

  1. [R3]ospf 1 router-id 3.3.3.3
  2. [R3-ospf-1]area 0
  3. [R3-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
  4. [R3-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255
  5. [R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

R4

  1. [R4]ospf 1 router-id 4.4.4.4
  2. [R4-ospf-1]area 0
  3. [R4-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.0
  4. [R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0

激活MPLS

R2

  1. [R2]mpls lsr-id 2.2.2.2
  2. [R2]mpls
  3. Info: Mpls starting, please wait... OK!
  4. [R2-mpls]mpls ld
  5. [R2-mpls-ldp] int g 0/0/01
  6. [R2-GigabitEthernet0/0/1]mpls
  7. [R2-GigabitEthernet0/0/1]mpls ld

R3

  1. [R3]mpls lsr-id 3.3.3.3
  2. [R3]mpls
  3. Info: Mpls starting, please wait... OK!
  4. [R3-mpls]mpls ldp
  5. [R3-mpls-ldp]int g 0/0/0
  6. [R3-GigabitEthernet0/0/0]mpls
  7. [R3-GigabitEthernet0/0/0]mpls ldp
  8. [R3-GigabitEthernet0/0/0]int g 0/0/1
  9. [R3-GigabitEthernet0/0/1]mpls
  10. [R3-GigabitEthernet0/0/1]mpls ldp
  11. [R3-GigabitEthernet0/0/1]

R4

  1. [R4]mpls lsr-id 4.4.4.4
  2. [R4]mpls
  3. Info: Mpls starting, please wait... OK!
  4. [R4-mpls]mpls ldp
  5. [R4-mpls-ldp]int g 0/0/0
  6. [R4-GigabitEthernet0/0/0]mpls
  7. [R4-GigabitEthernet0/0/0]mpls ldp
  8. [R4-GigabitEthernet0/0/0]

VRF创建

R2

  1. [R2]ip vpn-instance a --- VRF空间命名时大小写敏感
  2. [R2-vpn-instance-a]
  3. [R2-vpn-instance-a]route-distinguisher 100:1 --- 配置RD值
  4. [R2-vpn-instance-a-af-ipv4]
  5. [R2-vpn-instance-a-af-ipv4]vpn-target 100:1 export-extcommunity --- 配置出站RT
  6. EVT Assignment result:
  7. Info: VPN-Target assignment is successful.
  8. [R2-vpn-instance-a-af-ipv4]vpn-target 100:2 import-extcommunity --- 配置入站RT
  9. IVT Assignment result:
  10. Info: VPN-Target assignment is successful.

R4

  1. [R4]ip vpn-instance b
  2. [R4-vpn-instance-b]
  3. Apr 19 2023 11:44:15-08:00 R4 %%01LDP/4/SSNHOLDTMREXP(l)[1]:Sessions were delete
  4. d because the session hold timer expired and the notification of the expiry was
  5. sent to the peer 3.3.3.3.
  6. [R4-vpn-instance-b]route-distinguisher 200:1
  7. [R4-vpn-instance-b-af-ipv4]vpn-target 100:2 export-extcommunity
  8. EVT Assignment result:
  9. Info: VPN-Target assignment is successful.
  10. [R4-vpn-instance-b-af-ipv4]vpn-target 100:1 import-extcommunity
  11. IVT Assignment result:
  12. Info: VPN-Target assignment is successful.
  13. [R4-vpn-instance-b-af-ipv4]

将接口画入VRF空间

R2

  1. [R2-GigabitEthernet0/0/0]ip binding vpn-instance a
  2. Info: All IPv4 related configurations on this interface are removed!
  3. Info: All IPv6 related configurations on this interface are removed!
  4. [R2-GigabitEthernet0/0/0]

R4

  1. [R4-GigabitEthernet0/0/1]ip binding vpn-instance b
  2. Apr 19 2023 11:46:19-08:00 R4 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP
  3. on the interface GigabitEthernet0/0/1 has entered the DOWN state.
  4. Info: All IPv4 related configurations on this interface are removed!
  5. Info: All IPv6 related configurations on this interface are removed!
  6. [R4-GigabitEthernet0/0/1]

注意:

        画入后会清除之前配置的所有IPV4、IPV6

配置接口IP地址

R2

[R2-GigabitEthernet0/0/0]ip address 192.168.2.2 24

R4

  1. [R4]int g 0/0/1
  2. [R4-GigabitEthernet0/0/1]ip address 192.168.3.1 24

站点1基本配置

  1. [R1]int g 0/0/0
  2. [R1-GigabitEthernet0/0/0]ip ad
  3. [R1-GigabitEthernet0/0/0]ip address 192.168.2.1 24
  4. [R1]int l 0
  5. [R1-LoopBack0]ip address 192.168.1.1 24

站点2基本配置

  1. [R5]int g 0/0/0
  2. [R5-GigabitEthernet0/0/0]ip address 192.168.3.2 24
  3. [R5-LoopBack0]ip address 192.168.4.1 24

通过静态路由在CE和PE上配置

  1. [R1]ip route-static 192.168.3.0 24 192.168.2.2
  2. [R1]ip route-static 192.168.4.0 24 192.168.2.2
  3. [R2]ip route-static vpn-instance a 192.168.1.0 24 192.168.2.1
  4. [R5]ip route-static 192.168.2.0 24 192.168.3.1
  5. [R5]ip route-static 192.168.1.0 24 192.168.3.1
  6. [R4]ip route-static vpn-instance b 192.168.4.0 24 192.168.3.2

启动BGP

        使用IBGP即可

  1. [R2]bgp 1
  2. [R2-bgp]router-id 2.2.2.2
  3. [R2-bgp]peer 4.4.4.4 as 1
  4. [R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
  5. [R4]bgp 1
  6. [R4-bgp]router-id 4.4.4.4
  7. [R4-bgp]peer 2.2.2.2 as 1
  8. [R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0

建立MP-BGP邻居

        在BGPV4邻居关系建立好之后进入到VPNV4

  1. [R2-bgp]ipv4-family vpnv4
  2. [R2-bgp-af-vpnv4]
  3. [R2-bgp-af-vpnv4]peer 4.4.4.4 enable --- 因为PE设备之间需要传递VPNV4路由 ,所以,在普通的BGPV4邻居关系建立的基础上,需要在VPNV4地址族中激活邻居关系
  4. [R4-bgp]ipv4-family vpnv4
  5. [R4-bgp-af-vpnv4]peer 2.2.2.2 enable

发布站点1信息

[R2-bgp]ipv4-family vpn-instance a --- 在VRF空间中发布路由信息

发布直连路由以及静态路由

  1. [R2-bgp-a]import-route direct
  2. [R2-bgp-a]import-route static

测试

发布站点2的路由信息

[R4-bgp]ipv4-family vpn-instance b

发布路由(neetwork发布)

  1. [R4-bgp-b]network 192.168.3.0 24
  2. [R4-bgp-b]network 192.168.4.0 24

测试

 连通性测试

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/567705
推荐阅读
相关标签
  

闽ICP备14008679号