【方案】基于ensp的mpls vpn跨域optionA方案(分公司之间不能互访但是能访问总部场景)

目录

一 实验拓扑

二 实验要求

三 实验分析

四 实验配置说明

4.1完成正常ip地址配置,ISP内部使用ospf协议和mpls ldp协议

4.2 PE和CE之间起ebgp邻居

4.3 PE和PE之间起mpbgp邻居

4.4 PE和CE、ASBR之间设置VRF来进行RT值的过滤,选择合适的RT值来完成需求


一 实验拓扑

二 实验要求

  • 使用mpls 跨域场景,其中R1是总公司,R8,R9是分公司,要求R8和R9可以访问R1,但是R8和R9之间不能互访。
  • PE和CE之间使用BGP建立邻居

三 实验分析

  • 首先完成ip的正常配置,Isp使用IBG协议ospf,开启mpls ldp
  • PE和CE之间设置VRF,并起bgp邻居
  • PE和PE之间起MPBGP邻居
  • ASBR之间设置VRF
  • 设置合适的RT值,让分部之间无法互访,但只能访问总部,要想满足需求,可以将两个分部的导入和导出设置为一样的,这样就一定无法互访了,然后再在靠近分部的asbr上的导出和导入值和PE上的正好相反,即导出等于导入,这样分部就可访问总部

四 实验配置说明

4.1完成正常ip地址配置,ISP内部使用ospf协议和mpls ldp协议

R2:

mpls lsr-id 2.2.2.2
mpls
mpls ldp
ospf 1 
 area 0.0.0.0
interface GigabitEthernet0/0/1
 ip address 23.1.1.2 255.255.255.0 
 ospf enable 1 area 0.0.0.0
 mpls
 mpls ldp
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255 
 ospf enable 1 area 0.0.0.0

R3:

mpls lsr-id 3.3.3.3
mpls
mpls ldp
ospf 1 
 area 0.0.0.0
interface GigabitEthernet0/0/0
 ip address 23.1.1.3 255.255.255.0 
 ospf enable 1 area 0.0.0.0
 mpls
 mpls ldp
interface GigabitEthernet0/0/1
 ip address 34.1.1.3 255.255.255.0 
 ospf enable 1 area 0.0.0.0
 mpls
 mpls ldp
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255 
 ospf enable 1 area 0.0.0.0

R4:

mpls lsr-id 4.4.4.4
mpls
mpls ldp
ospf 1 
 area 0.0.0.0
interface GigabitEthernet0/0/0
 ip address 24.1.1.4 255.255.255.0 
 ospf enable 1 area 0.0.0.0
 mpls
 mpls ldp
interface LoopBack0
 ip address 4.4.4.4 255.255.255.255 
 ospf enable 1 area 0.0.0.0

R5:

mpls lsr-id 5.5.5.5
mpls
mpls ldp
ospf 1 
 area 0.0.0.0
interface GigabitEthernet0/0/1
 ip address 56.1.1.5 255.255.255.0 
 ospf enable 1 area 0.0.0.0
 mpls
 mpls ldp
interface LoopBack0
 ip address 5.5.5.5 255.255.255.255 
 ospf enable 1 area 0.0.0.0

R6:

mpls lsr-id 6.6.6.6
mpls
mpls ldp
ospf 1 
 area 0.0.0.0
interface GigabitEthernet0/0/0
 ip address 56.1.1.6 255.255.255.0 
 ospf enable 1 area 0.0.0.0
 mpls
 mpls ldp
interface GigabitEthernet0/0/1
 ip address 67.1.1.6 255.255.255.0 
 ospf enable 1 area 0.0.0.0
 mpls
 mpls ldp
interface LoopBack0
 ip address 6.6.6.6 255.255.255.255 
 ospf enable 1 area 0.0.0.0

R7:

mpls lsr-id 7.7.7.7
mpls
mpls ldp
ospf 1 
 area 0.0.0.0
interface GigabitEthernet0/0/0
 ip address 67.1.1.7 255.255.255.0 
 ospf enable 1 area 0.0.0.0
 mpls
 mpls ldp
interface LoopBack0
 ip address 7.7.7.7 255.255.255.255 
 ospf enable 1 area 0.0.0.0

4.2 PE和CE之间起ebgp邻居

R1:

bgp 100
 peer 12.1.1.2 as-number 200 
 #
 ipv4-family unicast
  undo synchronization
  network 1.1.1.1 255.255.255.255 
  peer 12.1.1.2 enable

R2:

ip vpn-instance aaa
 ipv4-family
  route-distinguisher 1:1
  vpn-target 100:1 export-extcommunity
  vpn-target 100:1 import-extcommunity
bgp 200
 ipv4-family vpn-instance aaa 
  peer 12.1.1.1 as-number 100 

R8:

bgp 400
 peer 78.1.1.7 as-number 300 
 #
 ipv4-family unicast
  undo synchronization
  network 8.8.8.8 255.255.255.255 
  peer 78.1.1.7 enable

R9:

bgp 400
 peer 79.1.1.7 as-number 300 
 #
 ipv4-family unicast
  undo synchronization
  network 9.9.9.9 255.255.255.255 
  peer 79.1.1.7 enable

R7:

ip vpn-instance ddd
 ipv4-family
  route-distinguisher 1:4
  vpn-target 300:1 export-extcommunity
  vpn-target 400:1 import-extcommunity
#
ip vpn-instance eee
 ipv4-family
  route-distinguisher 1:5
  vpn-target 300:1 export-extcommunity
  vpn-target 400:1 import-extcommunity
#
bgp 300
 ipv4-family vpn-instance ddd 
  peer 78.1.1.8 as-number 400 
 #
 ipv4-family vpn-instance eee 
  peer 79.1.1.9 as-number 400 
#

4.3 PE和PE之间起mpbgp邻居

R2:

bgp 200
 peer 4.4.4.4 as-number 200 
 peer 4.4.4.4 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 4.4.4.4 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 4.4.4.4 enable

R4:

bgp 200
 peer 2.2.2.2 as-number 200 
 peer 2.2.2.2 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 2.2.2.2 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 2.2.2.2 enable
 #

R5:

bgp 300
 peer 7.7.7.7 as-number 300 
 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
 #

R7:

bgp 300
 peer 5.5.5.5 as-number 300 
 peer 5.5.5.5 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 5.5.5.5 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 5.5.5.5 enable
 #

4.4 PE和CE、ASBR之间设置VRF来进行RT值的过滤,选择合适的RT值来完成需求

R4:

ip vpn-instance bbb
 ipv4-family
  route-distinguisher 1:2
  vpn-target 100:1 export-extcommunity
  vpn-target 100:1 import-extcommunity
#
bgp 200
 ipv4-family vpn-instance bbb 
  peer 45.1.1.5 as-number 300 
#

R5:

ip vpn-instance ccc
 ipv4-family
  route-distinguisher 1:3
  vpn-target 400:1 export-extcommunity
  vpn-target 300:1 import-extcommunity
#
bgp 300
 peer 45.1.1.4 as-number 200 
 ipv4-family vpn-instance ccc 
  peer 45.1.1.4 as-number 200 
#

检查连通性:

R8和R1:

R9和R1:

R8和R9:

实验效果理想


欢迎各位大佬在评论区或私信批评指正!!

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

天亮之前_ict

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值