新风花雪月 发表于 2018-7-22 07:46:44

CISCO MPLS *** 标签转发表项

注,在该案例研究中,我们全程关注私网路由4.4.4.4/32。在公网中,需要关注公网路由2.2.2.2/32  1、Ingress-PE
  1)、VRP路由表:show ip route vrf <vrf>
  Routing Table: ***1
  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
  4.0.0.0/32 is subnetted, 1 subnets
  B       4.4.4.4 via 2.2.2.2, 00:28:54
  5.0.0.0/32 is subnetted, 1 subnets
  B       5.5.5.5 via 172.16.35.5, 00:29:38
  172.17.0.0/24 is subnetted, 1 subnets
  B       172.17.24.0 via 2.2.2.2, 00:30:55
  172.16.0.0/24 is subnetted, 2 subnets
  C       172.16.35.0 is directly connected, FastEthernet1/0.1
  B       172.16.24.0 via 2.2.2.2, 00:30:55
  2)、私网标签:show ip bgp ***v4 vrf <vrf> labels
  C3600-R3#show ip bgp ***v4 vrf ***1 labels
  Network          Next Hop      In label/Out label
  Route Distinguisher: 65000:300 (***1)
  4.4.4.4/32       2.2.2.2         nolabel/22
  5.5.5.5/32       172.16.35.5   21/nolabel
  172.16.24.0/24   2.2.2.2         nolabel/20
  172.16.35.0/24   172.16.35.5   20/nolabel
  0.0.0.0         20/aggregate(***1)
  172.17.24.0/24   2.2.2.2         nolabel/21
  只显示私网标签,为了了解转发过程的完整性,可以根据下一跳进一步查找公网标签
  3)、公网标签:show mpls forwarding-table
  C3600-R3#show mpls forwarding-table
  LocalOutgoing    Prefix            Bytes tagOutgoing   Next Hop

  tag    tag or VC   or Tunnel>  17   Pop tag   1.1.1.1/32      0          Fa0/0      172.16.13.1
  18   16          2.2.2.2/32      0          Fa0/0      172.16.13.1
  19   Pop tag   172.16.12.0/24    0          Fa0/0      172.16.13.1
  20   Aggregate   172.16.35.0/24 1164
  21   Untagged    5.5.5.5/32   0          Fa1/0.1    172.16.35.5
  主要关注到2.2.2.2/32的标签,结合2)、3)命令的输出,可以看出到私网路由4.4.4.4/32的公网标签为16,私网标签为22。即,标签栈为{16,22},到该私网目的地址的数据包会打上两层标签{16,22}
  4)、私网 cef:show ip cef vrf <vrf> <dest ip>
  该命令的好处就是,可以看到完整的标签栈
  C3600-R3#show ip cef vrf ***1 4.4.4.4
  4.4.4.4/32, version 13, epoch 0, cached adjacency 172.16.13.1
  0 packets, 0 bytes
  tag information set
  local tag: ***-route-head
  fast tag rewrite with Fa0/0, 172.16.13.1, tags imposed: {16 22}
  via 2.2.2.2, 0 dependencies, recursive
  next hop 172.16.13.1, FastEthernet0/0 via 2.2.2.2/32
  valid cached adjacency
  tag rewrite with Fa0/0, 172.16.13.1, tags imposed: {16 22}
  输出结果和2)、 3)命令得出的结果是一致的,但是使用更方便
  2、P
  1)、公网标签转发表:show mpls forwarding-table
  C3600-R1#show mpls forwarding-table
  LocalOutgoing    Prefix            Bytes tagOutgoing   Next Hop

  tag    tag or VC   or Tunnel>  16   Pop tag   2.2.2.2/32      73         Fa0/0      172.16.12.2
  18   Pop tag   3.3.3.3/32      11751      Fa1/0      172.16.13.3
  关注到2.2.2.2/32的表项,入标签(Local Tag)和1.4)中的公网标签一致。出标签执行Pop操作(倒数第二跳弹出)。
  3、Egress-PE
  1)、VRF路由表
  C3600-R2#show ip route vrf ***1
  Routing Table: ***1
  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
  4.0.0.0/32 is subnetted, 1 subnets
  B       4.4.4.4 via 172.16.24.4, 01:17:52
  5.0.0.0/32 is subnetted, 1 subnets
  B       5.5.5.5 via 3.3.3.3, 01:18:16
  172.17.0.0/24 is subnetted, 1 subnets
  C       172.17.24.0 is directly connected, FastEthernet1/0.2
  172.16.0.0/24 is subnetted, 2 subnets
  B       172.16.35.0 via 3.3.3.3, 01:19:31
  C       172.16.24.0 is directly connected, FastEthernet1/0.1
  2)、私网标签:show ip bgp ***v4 vrf <vrf> labels
  C3600-R2#show ip bgp ***v4 vrf ***1 labels
  Network          Next Hop      In label/Out label
  Route Distinguisher: 65000:100 (***1)
  4.4.4.4/32       172.17.24.4   22/nolabel
  172.16.24.4   22/nolabel
  5.5.5.5/32       3.3.3.3         nolabel/21
  172.16.24.0/24   172.17.24.4   20/nolabel
  172.16.24.4   20/nolabel
  0.0.0.0         20/aggregate(***1)
  172.16.35.0/24   3.3.3.3         nolabel/20
  172.17.24.0/24   172.17.24.4   21/nolabel
  172.16.24.4   21/nolabel
  0.0.0.0         21/aggregate(***1)
  到私网路由4.4.4.4/32的入标签为22,和Ingress- PE打的私网标签一致。无出标签,转为IP转发。
页: [1]
查看完整版本: CISCO MPLS *** 标签转发表项