设为首页 收藏本站
查看: 772|回复: 0

[经验分享] MPLS-RIP实验文档

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-9-17 09:12:56 | 显示全部楼层 |阅读模式
                                                                   b_large_BPny_157800067f412d0d.jpg


Ip 地址如上图,Loopback 0 分别为 x.x.x.x/32  R1/R5是CE。R2/R3/R4是ISP:R2/R4是PE,R3是P。
步骤一、ISP内部 运行IGPOSPF)协议
R2:
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 23.0.0.2 0.0.0.0 area 0
R3:
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 23.0.0.3 0.0.0.0 area 0
network 34.0.0.3 0.0.0.0 area 0
R4:
router ospf 1
router-id 4.4.4.4
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 34.0.0.4 0.0.0.0 area 0
配置完检查邻居关系的建立:
R3:
R3#sh ip os nei   
Neighbor ID     Pri   State           Dead Time   Address         Interface
4.4.4.4           0   FULL/  -        00:00:38    34.0.0.4        Serial1/1
2.2.2.2           0   FULL/  -        00:00:32    23.0.0.2        Serial1/0
R2/R4上show ip route 查看路由是否学到
R2#   sh ip route     
34.0.0.0/24 is subnetted, 1 subnets
O       34.0.0.0 [110/128] via 23.0.0.3, 00:16:25, Serial1/1
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 23.0.0.3, 00:16:25, Serial1/1
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/129] via 23.0.0.3, 00:16:25, Serial1/1
     23.0.0.0/24 is subnetted, 1 subnets
C       23.0.0.0 is directly connected, Serial1/1
步骤二、ISP内部实现MPLS
R2:
mpls label range 200 300
mpls ldp route-id    lo 0
int s 1/1
mpls ip
R3:
mpls label range 300 400
mpls ldp route-id    lo 0
int s 1/1
mpls ip
int s 1/0
mpls ip
R4:
mpls label range 400 500
mpls ldp route-id    lo 0
int s 1/0
mpls ip
然后在R3上查看LDP 邻居的建立:
R3#sh mpls ldp neighbor
    Peer LDP Ident: 2.2.2.2:0; Local LDP Ident 3.3.3.3:0
        TCP connection: 2.2.2.2.646 - 3.3.3.3.33300
        State: Oper; Msgs sent/rcvd: 34/37; Downstream
        Up time: 00:23:03
        LDP discovery sources:
          Serial1/0, Src IP addr: 23.0.0.2
        Addresses bound to peer LDP Ident:
          23.0.0.2        2.2.2.2         
    Peer LDP Ident: 4.4.4.4:0; Local LDP Ident 3.3.3.3:0
        TCP connection: 4.4.4.4.32962 - 3.3.3.3.646
        State: Oper; Msgs sent/rcvd: 25/28; Downstream
        Up time: 00:14:27
        LDP discovery sources:
          Serial1/1, Src IP addr: 34.0.0.4
        Addresses bound to peer LDP Ident:
          34.0.0.4        4.4.4.4         
LDP邻居建立完成即可。
步骤三、ISP R2R4PE之间)建立MBPG-VPN关系
R2:
router bgp 1
no au                                                          默认关闭的
no syn                                                         默认关闭的
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 4.4.4.4 remote-as 1
neighbor 4.4.4.4 update-source Loopback0
!
address-family vpnv4
  neighbor 4.4.4.4 activate
  neighbor 4.4.4.4 send-community extended
exit-address-family
R4:
router bgp 1
no au
no syn
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 1
neighbor 2.2.2.2 update-source Loopback0
!
address-family vpnv4
  neighbor 2.2.2.2 activate
  neighbor 2.2.2.2 send-community extended
exit-address-family
检查邻居是否建立成功:
R4#   sh ip bg vpn all summary
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4     1      35      33        9    0    0 00:25:47        2
R2# sh ip bg vpn all su
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
4.4.4.4         4     1      34      36        9    0    0 00:26:14        2
步骤四、VRF的导入导出
R2/R4
创建VRF
ip vrf RIP
rd 1:1   
route-target export 1:1
route-target import 1:1
接口下启用VRF
R2  interface Serial1/0
I    p vrf forwarding RIP
R4  interface Serial1/1
ip vrf forwarding RIP
PE-CE间使用RIP路由协议
R1:
router rip
version 2
network 1.0.0.0
network 12.0.0.0
no auto-summary
R2:
router rip
version 2
no auto-summary
!
address-family ipv4 vrf RIP
  network 12.0.0.0
  no auto-summary
exit-address-family
R5:
router rip
version 2
network 5.0.0.0
network 45.0.0.0
no auto-summary
R4
router rip
version 2
no auto-summary
!
address-family ipv4 vrf RIP
  network 45.0.0.0
  no auto-summary
exit-address-family
R2/R4 VRF 和BGP路由相互重分布
R2/R4
router rip
version 2
no auto-summary
router bg  1
address-family ipv4 vrf RIP
  redistribute bgp 1 metric transparent                    度量透传,即METRIC不改变
  no auto-summary
exit-address-family
R2/R4 上检查VRF路由是否学到
R2#sh ip bg vpn all
   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf RIP)
*> 1.1.1.1/32       12.0.0.1                 1         32768 ?
*>i5.5.5.5/32       4.4.4.4                  1    100      0 ?
*> 12.0.0.0/24      0.0.0.0                  0         32768 ?
*>i45.0.0.0/24      4.4.4.4                  0    100      0 ?
查看R1/R5路由是否学到:
R1#        sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     5.0.0.0/32 is subnetted, 1 subnets
R       5.5.5.5 [120/2] via 12.0.0.2, 00:00:05, Serial1/1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, Serial1/1
     45.0.0.0/24 is subnetted, 1 subnets
R       45.0.0.0 [120/1] via 12.0.0.2, 00:00:05, Serial1/1
步骤五、测试MPLS ,查看转发过程标签转换情况
单方向从R1-R5观察:
R1#traceroute 5.5.5.5
Type escape sequence to abort.
Tracing the route to 5.5.5.5
  1 12.0.0.2 48 msec 48 msec 32 msec
  2 23.0.0.3 [MPLS: Labels 301/403 Exp 0] 112 msec 120 msec 160 msec
  3 45.0.0.4 [MPLS: Label 403 Exp 0] 108 msec 120 msec 108 msec
  4 45.0.0.5 128 msec *  104 msec
R2#sh ip cef vrf RIP detail
5.5.5.5/32, version 9, epoch 0, cached adjacency to Serial1/1
0 packets, 0 bytes
  tag information set
    local tag: VPN-route-head
    fast tag rewrite with Se1/1, point2point, tags imposed: {301 403}
  via 4.4.4.4, 0 dependencies, recursive
    next hop 23.0.0.3, Serial1/1 via 4.4.4.4/32
    valid cached adjacency
tag rewrite with Se1/1, point2point, tags imposed: {301 403}
R3#sh mpls forwarding-table
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop   
tag    tag or VC   or Tunnel Id      switched   interface              
301    Pop tag     4.4.4.4/32        4760       Se1/1      point2point  
R4#sh ip cef vrf RIP detail
5.5.5.5/32, version 10, epoch 0, cached adjacency to Serial1/1
0 packets, 0 bytes
  tag information set
    local tag: 403
  via 45.0.0.5, Serial1/1, 0 dependencies
    next hop 45.0.0.5, Serial1/1
    valid cached adjacency
    tag rewrite with Se1/1, point2point, tags imposed: {}



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-114721-1-1.html 上篇帖子: MPLS---OSPF试验 下篇帖子: Cisco ASA5505 密码恢复
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表