本文共 9113 字,大约阅读时间需要 30 分钟。
不得不说option C的配置非常复杂,光理解一些重分发就花了好多时间。
配置要点:1 . RR与RR之间配置MP-BGP邻居关系,就带来了需要两者之间下层传输需要可达。以下是topology
R1/R6 PER2/R5 RRR3/R4 ASBR配置部分R1 (PE1)ip vrf CustomerArd 100:1route-target export 100:1route-target import 200:1!router eigrp 100network 1.1.1.1 0.0.0.0network 12.1.1.1 0.0.0.0network 13.1.1.1 0.0.0.0!router ospf 100 vrf CustomerAredistribute bgp 100 subnetsnetwork 192.168.1.1 0.0.0.0 area 0!router bgp 100bgp log-neighbor-changesno bgp default ipv4-unicastneighbor 2.2.2.2 remote-as 100neighbor 2.2.2.2 update-source Loopback0!address-family ipv4neighbor 2.2.2.2 activateneighbor 2.2.2.2 next-hop-selfexit-address-family!address-family ***v4neighbor 2.2.2.2 activateneighbor 2.2.2.2 send-community extendedexit-address-family!address-family ipv4 vrf CustomerAredistribute ospf 100 match internal external 1 external 2exit-address-family!R2(RR1)router eigrp 100network 0.0.0.0!router bgp 100bgp log-neighbor-changesno bgp default ipv4-unicastneighbor 1.1.1.1 remote-as 100neighbor 1.1.1.1 update-source Loopback0neighbor 3.3.3.3 remote-as 100neighbor 3.3.3.3 update-source Loopback0neighbor 5.5.5.5 remote-as 200neighbor 5.5.5.5 ebgp-multihop 255neighbor 5.5.5.5 update-source Loopback0!address-family ipv4network 1.1.1.1 mask 255.255.255.255network 2.2.2.2 mask 255.255.255.255neighbor 1.1.1.1 activateneighbor 3.3.3.3 activateexit-address-family!address-family ***v4neighbor 1.1.1.1 activateneighbor 1.1.1.1 send-community extendedneighbor 1.1.1.1 route-reflector-clientneighbor 5.5.5.5 activateneighbor 5.5.5.5 send-community extendedneighbor 5.5.5.5 next-hop-unchangedexit-address-family!R3 (ASBR1)router eigrp 100network 3.3.3.3 0.0.0.0network 13.1.1.3 0.0.0.0network 23.1.1.3 0.0.0.0redistribute bgp 100 metric 10000 100 255 1 1500 route-map EIGRP!router bgp 100bgp log-neighbor-changesno bgp default ipv4-unicastneighbor 2.2.2.2 remote-as 100neighbor 2.2.2.2 update-source Loopback0neighbor 34.1.1.4 remote-as 200!address-family ipv4neighbor 2.2.2.2 activateneighbor 2.2.2.2 next-hop-selfneighbor 34.1.1.4 activateneighbor 34.1.1.4 route-map Set_Label outneighbor 34.1.1.4 send-labelexit-address-family!ip prefix-list PE1 seq 5 permit 1.1.1.1/32!route-map EIGRP permit 10match mpls-label!route-map Set_Label permit 10match ip address prefix-list PE1set mpls-label!route-map Set_Label permit 20R4
router eigrp 100network 4.4.4.4 0.0.0.0network 45.1.1.4 0.0.0.0network 46.1.1.4 0.0.0.0redistribute bgp 200 metric 10000 100 255 1 1500 route-map EIGRP!router bgp 200bgp log-neighbor-changesno bgp default ipv4-unicastneighbor 5.5.5.5 remote-as 200neighbor 5.5.5.5 update-source Loopback0neighbor 34.1.1.3 remote-as 100!address-family ipv4network 5.5.5.5 mask 255.255.255.255neighbor 5.5.5.5 activateneighbor 5.5.5.5 next-hop-selfneighbor 34.1.1.3 activateneighbor 34.1.1.3 route-map Set_Label outneighbor 34.1.1.3 send-labelexit-address-family!ip forward-protocol ndno ip http serverno ip http secure-server!!!!ip prefix-list PE2 seq 5 permit 6.6.6.6/32no cdp log mismatch duplex!route-map EIGRP permit 10match mpls-label!route-map Set_Label permit 10match ip address prefix-list PE2set mpls-label!route-map Set_Label permit 20!R5
router eigrp 100network 0.0.0.0!router bgp 200bgp log-neighbor-changesno bgp default ipv4-unicastneighbor 2.2.2.2 remote-as 100neighbor 2.2.2.2 ebgp-multihop 255neighbor 2.2.2.2 update-source Loopback0neighbor 4.4.4.4 remote-as 200neighbor 4.4.4.4 update-source Loopback0neighbor 6.6.6.6 remote-as 200neighbor 6.6.6.6 update-source Loopback0!address-family ipv4network 6.6.6.6 mask 255.255.255.255neighbor 4.4.4.4 activateneighbor 6.6.6.6 activateexit-address-family!address-family ***v4neighbor 2.2.2.2 activateneighbor 2.2.2.2 send-community extendedneighbor 2.2.2.2 next-hop-unchangedneighbor 6.6.6.6 activateneighbor 6.6.6.6 send-community extendedneighbor 6.6.6.6 route-reflector-clientexit-address-family!R6ip vrf CustomerArd 200:1route-target export 200:1route-target import 100:1router eigrp 100
network 6.6.6.6 0.0.0.0network 46.1.1.6 0.0.0.0network 56.1.1.6 0.0.0.0!router ospf 100 vrf CustomerAredistribute bgp 200 subnetsnetwork 192.168.2.1 0.0.0.0 area 0!router bgp 200bgp log-neighbor-changesno bgp default ipv4-unicastneighbor 5.5.5.5 remote-as 200neighbor 5.5.5.5 update-source Loopback0!address-family ipv4neighbor 5.5.5.5 activateexit-address-family!address-family ***v4neighbor 5.5.5.5 activateneighbor 5.5.5.5 send-community extendedexit-address-family!address-family ipv4 vrf CustomerAredistribute ospf 100 match internal external 1 external 2exit-address-family!配置分析主要集中在RR和ASBR上,先来看RR
路由反射器需要和己方AS PE建立***v4邻居关系,(当然PE是RR的client)R2 address-family ipv4neighbor 1.1.1.1 activateaddress-family ***v4neighbor 1.1.1.1 activateneighbor 1.1.1.1 send-community extendedneighbor 1.1.1.1 route-reflector-clientR4
address-family ipv4neighbor 6.6.6.6 activateaddress-family ***v4neighbor 6.6.6.6 activateneighbor 6.6.6.6 send-community extendedneighbor 6.6.6.6 route-reflector-client之前提到过RR与RR之间要建立***v4邻居关系,意味着底层ipv4要打通。
R3
address-family ipv4network 1.1.1.1 mask 255.255.255.255R4address-family ipv4network 5.5.5.5 mask 255.255.255.255之后RR之间再建立***v4的邻居关系
R2 router bgp 100neighbor 5.5.5.5 remote-as 200neighbor 5.5.5.5 ebgp-multihop 255neighbor 5.5.5.5 update-source Loopback0!address-family ***v4neighbor 5.5.5.5 activateneighbor 5.5.5.5 send-community extendedneighbor 5.5.5.5 next-hop-unchangedR5
router bgp 200address-family ***v4neighbor 2.2.2.2 remote-as 100neighbor 2.2.2.2 ebgp-multihop 255neighbor 2.2.2.2 update-source Loopback0!address-family ***v4neighbor 2.2.2.2 activateneighbor 2.2.2.2 send-community extendedneighbor 2.2.2.2 next-hop-unchanged此时,下一跳不改变是为了之后数据层面不经过次优路径做的,这里偷懒后面不解释了。
同时,这个bgp邻居需要multihop,改成相应的数值就行。接下来看ASBR。当提及跨域MPLS时候,反复强调一点 即路由器需要为下一跳分发标签。牢记这点其实逻辑也不难。
在ebgp邻居上使用send-label命令
R3neighbor 34.1.1.4 send-labelR4neighbor 34.1.1.3 send-labelR4
ip prefix-list PE2 seq 5 permit 6.6.6.6/32! route-map EIGRP permit 10match mpls-label!route-map Set_Label permit 10match ip address prefix-list PE2set mpls-label!route-map Set_Label permit 20!router bgp 200address-family ipv4neighbor 34.1.1.3 route-map Set_Label out3.需要advertise对端PE的loopback地址,否则之前使用的next-hop-unchanged的下一跳会不优
R3 address-family ipv4network 1.1.1.1 mask 255.255.255.255R4address-family ipv4network 6.6.6.6 mask 255.255.255.2554.把打了标签的bgp路由重分发进IGP中
另外,ASBR只需要运行普通ipv4 BGP就行了。R3
redistribute bgp 100 metric 10000 100 255 1 1500 route-map EIGRPR4
redistribute bgp 200 metric 10000 100 255 1 1500 route-map EIGRP此时,彼方IGP中会有条己方AS PE的路由
R1#show ip route | in EXD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaD EX 6.6.6.6 [170/281856] via 13.1.1.3, 01:10:09, GigabitEthernet0/0R6#sh ip route | in EX
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaD EX 1.1.1.1 [170/281856] via 46.1.1.4, 00:41:01, GigabitEthernet2/0R6配置分析完了,来看数据层面
R1#show ip cef vrf CustomerA 22.22.22.22 detail
22.22.22.22/32, epoch 0, flags rib defined all labelsrecursive via 6.6.6.6 label 605nexthop 13.1.1.3 GigabitEthernet0/0 label 307PE端,内层标签605,外层标签307
R3#show mpls forwarding-table labels 307
Local Outgoing Prefix Bytes Label Outgoing Next HopLabel Label or Tunnel Id Switched interface307 400 6.6.6.6/32 610 Gi1/0 34.1.1.4R4#show mpls forwarding-table labels 400
Local Outgoing Prefix Bytes Label Outgoing Next HopLabel Label or Tunnel Id Switched interface400 Pop Label 6.6.6.6/32 1180 Gi2/0 46.1.1.6R6#show mpls forwarding-table labels 605
Local Outgoing Prefix Bytes Label Outgoing Next HopLabel Label or Tunnel Id Switched interface605 No Label 22.22.22.22/32[V] \1140 Gi0/0 192.168.2.33配上一个BGP update的抓包,由R2发送给R5,NLRI 11.11.11.11/32, 下一跳1.1.1.1 label是103
optionC的确要比option B分析起来简单些,当然配起来的确很绕。有时间回来把这实验再敲一遍。过两天研究IS-IS和MPLS TE。补充一份最近搜到的Cisco live讲inter-as ×××的截图。第一幅图是控制层面的BGP标签分发。PE端分发的标签,将下一跳,RT RD VRF 及标签绑定在一起,但是注意,下一跳仍然是最关键的。当BGP充当标签分发器时,永远是根据下一跳分发的。即使是ASBR之间的label unicast,也仍然依照next hop value分发。所以在传递的过程中,其实是三层标签。LSP/ASBR/remote PE
4月9号更新,上一个其实还是有点问题。把两个问题写下来。为什么要重分发对端的PE 环回口,因为在查询vrf路由的时候,下一眺的recursive lookup一定要在global RIB中。
如果不重分发,那11.11.11.11/32前面的星号就没了。第二,使用show ip bgp ***v4 rd 200:1 label来查看本地发放了什么标签给对端。
第三,查看路由表,bgp路由下一跳,以及PE收到的关于此下一跳的标签就可以明白标签是如何堆叠的。为何这种方法是两层标签,是因为我们把对端PE的环回口发送进了本地IGP。使得在标签分发的过程中,这个对端PE对于本地分发标签的时候就好像本地AS的路由一样。
转载于:https://blog.51cto.com/9272543/2058009