MPLS单域配置

7 篇文章 0 订阅

一.配置实例

实验目的:在R1能够ping 5.5.5.5 source 1.1.1.1

1.基本IP配置

2.Core内运行OSPF

R2

Router(config)# router ospf 100

Router(config-router)# router-id 2.2.2.2
 
Router(config-router)# network 2.2.2.2 0.0.0.0 area 0
 
Router(config-router)# network 10.1.23.2 0.0.0.0 area 0
R3

Router(config)# router ospf 100

Router(config-router)# router-id 3.3.3.3
 
Router(config-router)#  network 3.3.3.3 0.0.0.0 area 0
 
Router(config-router)# network 10.1.23.3 0.0.0.0 area 0

Router(config-router)# network 10.1.34.3 0.0.0.0 area 0
R4

Router(config)# router ospf 100

Router(config-router)# router-id 4.4.4.4
 
Router(config-router)# network 4.4.4.4 0.0.0.0 area 0
 
Router(config-router)# network 10.1.34.4 0.0.0.0 area 0

3.激活MPLS

R2

Router(config)# ip cef

Router(config)# mpls label range 200 299

Router(config)# mpls ldp router-id Loopback0
 
Router(config)# int e0/1
 
Router(config-if)# mpls ip
R3

Router(config)# ip cef

Router(config)# mpls label range 300 399

Router(config)# mpls ldp router-id Loopback0
 
Router(config)# int e0/0
 
Router(config-if)# mpls ip

Router(config)# int e0/1
 
Router(config-if)# mpls ip
R4

Router(config)# ip cef

Router(config)# mpls label range 400 499

Router(config)# mpls ldp router-id Loopback0
 
Router(config)# int e0/0
 
Router(config-if)# mpls ip

4.创建并将PE-CE接口放入VRF

R2

Router(config)# ip vrf cisco

Router(config-vrf)# rd 234:2

Router(config-vrf)# route-target export 234:2
 
Router(config-vrf)# route-target import 234:4
 
Router(config)# int e0/0

Router(config-if)# ip vrf forwarding cisco

Router(config-if)# ip address 10.1.12.2 255.255.255.0
R4

Router(config)# ip vrf cisco

Router(config-vrf)# rd 234:4

Router(config-vrf)# route-target export 234:4
 
Router(config-vrf)# route-target import 234:2
 
Router(config)# int e0/1

Router(config-if)# ip vrf forwarding cisco

Router(config-if)# ip address 10.1.45.4 255.255.255.0

5.PE和CE间运行IGP协议

R1

Router(config)# router ospf 1

Router(config-router)# router-id 1.1.1.1
 
Router(config-router)#  network 1.1.1.1 0.0.0.0 area 0
 
Router(config-router)# network 10.1.12.1 0.0.0.0 area 0
R2

Router(config)# router ospf 1 vrf cisco

Router(config-router)# network 10.1.12.2 0.0.0.0 area 0
R4

Router(config)# router ospf 1 vrf cisco

Router(config-router)# network 10.1.45.4 0.0.0.0 area 0
R5

Router(config)# router ospf 1

Router(config-router)# router-id 5.5.5.5
 
Router(config-router)#  network 5.5.5.5 0.0.0.0 area 0
 
Router(config-router)# network 10.1.45.5 0.0.0.0 area 0

6.PE间建立MP-BGP邻居

R2

Router(config)# router bgp 234

Router(config-router)# bgp router-id 2.2.2.2
 
Router(config-router)# no bgp default ipv4-unicast  //减少不必要的IPv4 TCP连接保持
 
Router(config-router)# neighbor 4.4.4.4 remote-as 234

Router(config-router)# neighbor 4.4.4.4 update-source Loopback0

Router(config-router)# address-family vpnv4

Router(config-router-af)# neighbor 4.4.4.4 activate

Router(config-router-af)# neighbor 4.4.4.4 send-community extended  //系统自动添加
R4

Router(config)# router bgp 234

Router(config-router)# bgp router-id 4.4.4.4
 
Router(config-router)# no bgp default ipv4-unicast  //减少不必要的IPv4 TCP连接保持
 
Router(config-router)# neighbor 2.2.2.2 remote-as 234

Router(config-router)# neighbor 2.2.2.2 update-source Loopback0

Router(config-router)# address-family vpnv4

Router(config-router-af)# neighbor 2.2.2.2 activate

Router(config-router-af)# neighbor 2.2.2.2 send-community extended  //系统自动添加

7.PE-CE间路由重发布

R2

OSPF重分发入BGP

Router(config)# router bgp 234

Router(config-router)# address-family ipv4 vrf cisco
 
Router(config-router-af)# redistribute ospf 1 match internal external

BGP重分发入OSPF
 
Router(config)# router ospf 1 vrf cisco

Router(config-router)# redistribute bgp 234 subnets
R4

OSPF重分发入BGP

Router(config)# router bgp 234

Router(config-router)# address-family ipv4 vrf cisco
 
Router(config-router-af)# redistribute ospf 1 match internal external

BGP重分发入OSPF
 
Router(config)# router ospf 1 vrf cisco

Router(config-router)# redistribute bgp 234 subnets

8.查看命令

查看vpnv4邻居

Router# sh ip bgp vpnv4 all summary

查看VRF路由表

Router# sh ip route vrf cisco

9.控制层面

10.数据层面

二.RR路由器

R3作为RR路由器时,需要修改MP-BGP配置如下

R2

Router(config)# router bgp 234

Router(config-router)# bgp router-id 2.2.2.2
 
Router(config-router)# no bgp default ipv4-unicast  //减少不必要的IPv4 TCP连接保持
 
Router(config-router)# neighbor 3.3.3.3 remote-as 234

Router(config-router)# neighbor 3.3.3.3 update-source Loopback0

Router(config-router)# address-family vpnv4

Router(config-router-af)# neighbor 3.3.3.3 activate

Router(config-router-af)# neighbor 3.3.3.3 send-community extended  //系统自动添加
R3

Router(config)# router bgp 234

Router(config-router)# bgp router-id 3.3.3.3
 
Router(config-router)# no bgp default ipv4-unicast  //减少不必要的IPv4 TCP连接保持
 
Router(config-router)# neighbor 2.2.2.2 remote-as 234

Router(config-router)# neighbor 2.2.2.2 update-source Loopback0

Router(config-router)# neighbor 4.4.4.4 remote-as 234

Router(config-router)# neighbor 4.4.4.4 update-source Loopback0

Router(config-router)# address-family vpnv4

Router(config-router-af)# neighbor 2.2.2.2 activate

Router(config-router-af)# neighbor 4.4.4.4 activate

Router(config-router-af)# neighbor 2.2.2.2 route-reflector-client

Router(config-router-af)# neighbor 4.4.4.4 route-reflector-client

Router(config-router-af)# neighbor 2.2.2.2 send-community extended  //系统自动添加

Router(config-router-af)# neighbor 4.4.4.4 send-community extended  //系统自动添加
R4

Router(config)# router bgp 234

Router(config-router)# bgp router-id 4.4.4.4
 
Router(config-router)# no bgp default ipv4-unicast  //减少不必要的IPv4 TCP连接保持
 
Router(config-router)# neighbor 3.3.3.3 remote-as 234

Router(config-router)# neighbor 3.3.3.3 update-source Loopback0

Router(config-router)# address-family vpnv4

Router(config-router-af)# neighbor 3.3.3.3 activate

Router(config-router-af)# neighbor 3.3.3.3 send-community extended  //系统自动添加
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值