RR1,P1,ASBR1,ASBR2之间运行isis协议。RR2,P2.ASBR3,ASBR4之间运行isis协议,两个isis协议之间不打通。ASBR1/2处于bgp100中,ASBR3/4处于BGP200中,通过EBGP建立关系,目的是通过EBGP得到对方的ISIS 路由。
因为存在BGP与isis双向引入的情况,为了保证最优拓展性,必须在ASBR上使用tag解决路由回馈的问题。
ASBR1
route-policy permit permit node 10
apply tag 10//给ISIS引入BGP的路由打上TAG10的标签
isis 1
import-route bgp route-policy permit//给引入isis的bgp路由打上tag=10的标签
[ASBR1-isis-1]dis isis route | in 172 Route information for ISIS(1) ----------------------------- ISIS(1) Level-2 Forwarding Table -------------------------------- IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags ------------------------------------------------------------------------------- 172.16.1.5/32 0 NULL Loop0 Direct D/-/L/- 172.16.1.4/32 1050 NULL GE0/0/1 10.1.35.1 A/-/-/- 172.16.1.20/32 2520 NULL GE0/0/1 10.1.35.1 A/-/-/- 172.16.1.3/32 1000 NULL GE0/0/1 10.1.35.1 A/-/-/- 172.16.1.1/32 2500 NULL GE0/0/1 10.1.35.1 A/-/-/- 172.16.1.6/32 100 NULL GE0/0/0 10.1.56.2 A/-/-/- Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut, U-Up/Down Bit Set ISIS(1) Level-2 Redistribute Table ---------------------------------- Type IPV4 Destination IntCost ExtCost Tag ------------------------------------------------------------------------------- B 172.16.1.11/32 0 NULL 10 B 172.16.1.2/32 0 NULL 10 B 172.16.1.10/32 0 NULL 10 B 172.16.1.9/32 0 NULL 10 B 172.16.1.8/32 0 NULL 10 B 172.16.1.7/32 0 NULL 10 Type: D-Direct, I-ISIS, S-Static, O-OSPF, B-BGP, R-RIP, U-UNR
可以发现,由bgp引入isis的路由全部打上了TAG=10的标签,这些路由实际上是由ASBR3通过bgp告知ASBR1的。
ASBR2
ip ip-prefix isis index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32//匹配到172.16开头的路由,这些路由即可能是isis的路由,也可能是bgp的路由
#
route-policy deny deny node 10
if-match tag 10
#
route-policy deny permit node 20
if-match ip-prefix isis
bgp 100
import-route isis 1 route-policy deny//向bgp中引入isis的路由,遵从名为deny的路由策略,即引入开头为172.16的路由的同时deny掉其中tag为10的路由,这些路由是由ASBR1从BGP中获得的路由。为什么不往BGP中引入这些路由呢,因为这些路由本身就是由bgp得到的,描述的是ASBR3/4所在区域的路由的到达方式,即ASBR3/4所在区域的设备不用从BGP中获得这些路由,它们本身就已知道这些路由的到达方式。如果再从BGP中去获得,一方面绕了远路,另一方面,路由的路径就会成环,即下一跳成了环,永远无法到达正确的目的点。
这样,保证了ASBR2向BGP中引入路由永远是BGP的用户所确实需要的。
通过以上配置,我们可以确保,ASBR1获得了ASBR3传递来的路由,ASBR2通过isis和ASBR1得到了同步,同时,ASBR2向bgp中引入路由时(目的是告知ASBR4它已知的isis路由),避免了将自己间接从ASBR3学来的路由又还给了ASBR4。
同理。我们需要在ASBR2上将ASBR2从ASBR4学来的BGP路由引入ISIS ,同时,留个心眼,通过打标签的方式告诉ASBR1,这些路由是从ASBR4学来的,千万不要再还给ASBR3。
具体的命令是:
ASBR2
#
route-policy permit permit node 10
apply tag 20
isis 1
import-route bgp route-policy permit//向ISIS中引入自己通过BGP学习到的路由时给它们打上tag=20的标签。
ASBR1
ip ip-prefix isis index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32//匹配到172.16开头的路由,这些路由即可能是isis的路由,也可能是bgp的路由
#
route-policy deny deny node 10
if-match tag 20
#
route-policy deny permit node 20
if-match ip-prefix isis
bgp 100
ipv4-family unicast
import-route isis 1 route-policy deny//ASBR1需要把自己知道的路由通过BGP告诉ASBR3,同时避免告诉ASBR3它明明已经知道的路由。ASBR1判断ASBR3是否知道就是通过tag的方式。
那么,对面的ASBR3/ASBR4采用同样的方法,向ASBR1/ASBR2告知自己通过ISIS知道的路由,同时避免把ASBR1/2已经知道的路由再告诉它们。
ASBR3
route-policy permit permit node 10
apply tag 30
isis 1
import-route bgp route-policy permit
ASBR4
ip ip-prefix isis index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32
#
route-policy deny deny node 10
if-match tag 30
#
route-policy deny permit node 20
if-match ip-prefix isis
#
bgp 200
import-route isis 1 route-policy deny
ASBR4
route-policy permit permit node 10
apply tag 40
isis 1
import-route bgp route-policy permit
ASBR3
ip ip-prefix isis index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32
#
route-policy deny deny node 10
if-match tag 40
#
route-policy deny permit node 20
if-match ip-prefix isis
#
bgp 200
import-route isis 1 route-policy deny
聪明的你,相信已经不用我再解释上面的命令了。
经过我们上面一通操作,
ASBR1/2通过BGP获得了ASBR3/4的ISIS路由并把这些路由引入自己的ISIS路由中,ASBR3/4也通过BGP获得了ASBR1/2的ISIS路由并把这些路由引入自己的ISIS路由中,同时,避免了因为BGP、isis双向引入产生的路由反馈问题(即自己本身从对方获得的路由不能再还给对方,从而导致路由成环)