CCIE SP-ISIS L1/L2的区别
测试Topology
R1——R2——R3
R1设置is-type L1
R2默认L1/2
R3设置is-type L2
三个路由器都设置在一个域内,如下所示:
R1:47.0012.0010.0100.1001.00
R2:47.0012.0020.0200.2002.00
R3:47.0012.0030.0300.3003.00
1. 在L1/2上,将L1的路由信息(非拓扑信息)加入L2
在L1/2边界(R2),L1数据库(R1)中的路由会被加入到L2 LSP中,并传给L2的路由器;但来自L1的拓扑信息不会注入L2。此时的R2类似于ABR,他只把可达信息传给其他L2路由器,如R3,R3想要去R1,只能经过R2
R2#sh isis da IS-IS Level-1 Link State Database: LSPID LSP Seq Num LSP Checksum LSP Holdtime ATT/P/OL R1.00-00 0x00000002 0xDA1F 1184 0/0/0 R2.00-00 * 0x00000002 0x4ECD 1187 0/0/0 R2.01-00 * 0x00000001 0xA704 1187 0/0/0 IS-IS Level-2 Link State Database: LSPID LSP Seq Num LSP Checksum LSP Holdtime ATT/P/OL R2.00-00 * 0x00000003 0xD983 1195 0/0/0 R3.00-00 0x00000002 0x076B 1189 0/0/0 R3.01-00 0x00000001 0x5F6E 1189 0/0/0 R2# R2# R2#sh isis da de IS-IS Level-1 Link State Database: LSPID LSP Seq Num LSP Checksum LSP Holdtime ATT/P/OL R1.00-00 0x00000002 0xDA1F 1176 0/0/0 Area Address: 47.0012 NLPID: 0xCC Hostname: R1 IP Address: 1.1.1.1 Metric: 10 IP 10.1.1.0 255.255.255.0 Metric: 0 IP 1.1.1.1 255.255.255.255 Metric: 10 IS R2.01 R2.00-00 * 0x00000002 0x4ECD 1179 0/0/0 Area Address: 47.0012 NLPID: 0xCC Hostname: R2 IP Address: 2.2.2.2 Metric: 10 IP 10.1.1.0 255.255.255.0 Metric: 10 IP 23.1.1.0 255.255.255.0 Metric: 0 IP 2.2.2.2 255.255.255.255 Metric: 10 IS R2.01 R2.01-00 * 0x00000001 0xA704 1178 0/0/0 Metric: 0 IS R2.00 Metric: 0 IS R1.00 IS-IS Level-2 Link State Database: LSPID LSP Seq Num LSP Checksum LSP Holdtime ATT/P/OL R2.00-00 * 0x00000003 0xD983 1185 0/0/0 Area Address: 47.0012 NLPID: 0xCC Hostname: R2 IP Address: 2.2.2.2 Metric: 10 IS R3.01 Metric: 10 IP 1.1.1.1 255.255.255.255 Metric: 0 IP 2.2.2.2 255.255.255.255 Metric: 10 IP 10.1.1.0 255.255.255.0 Metric: 10 IP 23.1.1.0 255.255.255.0 R3.00-00 0x00000002 0x076B 1179 0/0/0 Area Address: 47.0012 NLPID: 0xCC Hostname: R3 IP Address: 3.3.3.3 Metric: 10 IS R3.01 Metric: 0 IP 3.3.3.3 255.255.255.255 Metric: 10 IP 23.1.1.0 255.255.255.0 R3.01-00 0x00000001 0x5F6E 1178 0/0/0 Metric: 0 IS R3.00 Metric: 0 IS R2.00 R2#show isis to IS-IS paths to level-1 routers System Id Metric Next-Hop Interface SNPA R1 10 R1 Fa1/0 ca00.2f68.001c R2 -- IS-IS paths to level-2 routers System Id Metric Next-Hop Interface SNPA R2 -- R3 10 R3 Fa3/0 ca02.2f68.0054
2. Attach-bit
默认情况下,L2路由器不会自动把L2的路由信息发给L1的路由器,与OSPF的默认行为不同,OSPF通过type4/5向非骨干区域通告外部路由。这时L1路由器更像OSPF中的完全存根网络,要想把数据发往其他区域,L1必须找到正确的L1/2路由器做中转,那么L1如何找到这个L1/2路由器?当L2路由器连接一个L1/2路由器时,并且两个属于不同的Area,那么L1/2路由器会在自己的L1 LSP中将ATTached置1,并传给其连的L1路由器,接到这个LSP的L1路由器会自动产生一条默认路由,指向L1/2。另外注意下,如果RIB里已经存在了一条默认路由,而且是静态的,那么isis的路由就不会放入RIB,但是在XR中可以通过“show isis route”来查看自己产生的默认路由。
回过头来看下上面的输出,R3是L2路由器,为什么R2没有置ATTached位?因为这3个路由器在同样的Area中(47.0012),把R3改成其他的Area,就可以了,如下所示:
R1#sh isis da IS-IS Level-1 Link State Database: LSPID LSP Seq Num LSP Checksum LSP Holdtime ATT/P/OL R1.00-00 * 0x00000005 0xD422 805 0/0/0 R2.00-00 0x00000005 0x50C0 808 1/0/0 R2.01-00 0x00000003 0xA306 795 0/0/0 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 10.1.1.2 to network 0.0.0.0 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 2.0.0.0/32 is subnetted, 1 subnets i L1 2.2.2.2 [115/10] via 10.1.1.2, FastEthernet1/0 23.0.0.0/24 is subnetted, 1 subnets i L1 23.1.1.0 [115/20] via 10.1.1.2, FastEthernet1/0 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, FastEthernet1/0 i*L1 0.0.0.0/0 [115/10] via 10.1.1.2, FastEthernet1/0
3. L2向L1路由泄漏
默认情况下,L2的路由不会注入到L1中,即使通过L1/2路由器也不行,如果在某些场景下,必须泄露L2的路由,如下图所示,如果不泄露明细,那么对于C来说就会通过负载到达Server。泄露通过路由重分发来完成“redistribution isis ip level-2 into level-1 distribute-list xxx”,另外需要注意跟其他路由协议不一样的就是,重分发后都是L2路由,不存在所谓的外部路由,因为ISIS原本是为承载CLNS路由的,所以它承载的IP路由都属于外部路由。
在RFC2966中定义路由泄露时,为了防止泄露的路由通过其他链路再回灌回L2中,定义了UP/Down Bit,默认为0,如果是从L2重分发进来的,会置1,L1/2路由器不会发送带有Up/Down Bit位的路由到L2中,下面文章有更详细的介绍:
IS-IS Route Leaking Overview
为了更好的认识UP/Down Bit,在R2上重分发R3的L2路由,并在R1上抓LSP的包,如下图所示:
注意在IOX中,路由泄漏已经不再用redistribution关键词,而是用“propagate level 2 into level 1 route-policy xxx”,因为在IOX中,明确了只有当两个不同协议之间或不同实例之间才能通过redistribution,这样就更合理了,本身路由泄漏跟重分发就不是一个东西!另外对于泄漏的metric,默认都是10,对于isis inter-area-propagate 来说,是不能改metric。
重分发和L1/2路由优选的问题
重分发主要看metric-type,选internal时产生的metric是0,跟自己的内部路由一样;而选external后,metric是64。对于重分发的路由不管是internal还是external,它都属于外部路由,在数据库中以“IP-External”标示。