MPLS基础实验(思科)

MPLS基础实验

拓扑图

  1. 完成基本ip配置

  1. Core内运行OSPF(进程号100),激活MPLS

PE1配置
router osof 100
router-id 2.2.2.2
network 10.1.23.0 0.0.0.255 area 0
network 2.2.2.2 0.0.0.0 area 0
ip cef     //必须开启ip cef
mpls ldp router-id loopback 0 //设置LDP router-id
mpls label range 200 299    //设置标签范围.(为了方便观察实验现象及容易排错)
interface eth0/1
mpls ip  //接口下启用mpls
P配置
router ospf 100
router-id 3.3.3.3
network 3.3.3.3 0.0.0.0 area 0
network 10.1.23.0 0.0.0.255 area 0
network 10.1.34.0 0.0.0.255 area 0
ip cef
mpls ldp router-id loopback0
mpls label range 300 399
interface eth0/0
mpls ip
interface eth0/1
mpls ip
PE2配置
router ospf 100
router-id 4.4.4.4
network 4.4.4.4 0.0.0.0 area 0
network 10.1.34.0 0.0.0.255 area 0
ip cef
mpls ldp router-id loopback0
mpls label range 400 499
interface eth 0/0
mpls ip
  1. 在PE上创建VRF,将PE-CE间的接口放入VRF;在PE和CE之间运行IGP协议

PE1配置VRF
ip vrf cisco  //创建vrf
rd 234:2    //设置rd值(自定义)
route-target export 234:2    //设置输出rt值(自定义)
route-target import 234:4    //设置输入rt值(自定义)
interface eth0/0
ip vrf forwarding cisco  //把物理端口放到名为vrf的cisco里
ip address 10.1.12.2 255.255.255.0  
router ospf 1 vrf cisco  //进入到cisco宣告路由
network 10.1.12.0 0.0.0.255 area 0
PE2配置VRF
ip vrf cisco  
rd 234:4    
route-target export 234:4   
route-target import 234:2
interface eth0/1
ip vrf forwarding cisco  
ip address 10.1.45.4 255.255.255.0  
router ospf 1 vrf cisco  
network 10.1.45.0 0.0.0.255 area 0
  1. PE配置MP-BGP,建立MP-iBGP邻居关系

PE1配置
router bgp 234
neighbor 4.4.4.4 remote-as 234
neighbor 4.4.4.4 update-source loopback 0
address-family vpnv4   // 开启vpnv4
neighbor 4.4.4.4 activate   //激活vpnv4邻居4.4.4.4的连接
PE2配置
router bgp 234
no bgp default ipv4-unicast  //关闭维护ipv4bgp的连接
neighbor 2.2.2.2 remote-as 234
neighbor 2.2.2.2 update-source loopback 0
address-family vpnv4   
neighbor 2.2.2.2 activate   
  1. 完成PE-CE之间路由重分布

PE1配置
router bgp 234
address-family ipv4 vrf cisco   //进入到名为cisco虚拟路由发布ipv4 ospf路由
redistribute ospf 1 vrf cisco match external 发布ospf路由(math表示内部路由,external表示外部路由)

router ospf 1 vrf cisco
redistribute bgp 234 subnets  //ospf发布bgp路由

show ip bgp vpnv4 all  //查看vpnv4路由
show ip bgp vpnv4 all labels //查看vpnv4路由标签
PE4配置
router ospf 1 vrf cisco
redistribute bgp 234 subnets  //ospf发布bgp路由

router bgp 234  //bgp引入ospf路由,也就是回程路由
address-family ipv4 vrf cisco
redistribute ospf 1 match internal external  

测试

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值