一、拓扑图:
 
 
 
 
 
二、配置和说明:
 
1、配置各路由器的IP确保直连链路的能通。指定接口运行的Level ,以及路由的运行的Level。图中除了R5路由运行了L1其它的都是默认的L1-2.下面以R1来为例:
在路由接口指定发送isis报文类型,标识号我用cisco
R1(config)#int lo 0
R1(config-if)#ip router isis cisco (注意是在接口下启用,所以用ip route)
R1(config-if)#isis circuit-type level-1(特定线路为L1类型,这样发到R2接口S1/0L1,但是我们却要把S1/0接口指定为L2,所以我们看一下R2收到的路由会全为L2类型)
 
R2#show 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
 
     172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks
i L2    172.16.128.0/24 [115/40] via 172.16.255.6, Serial1/1
i L2    172.16.129.0/24 [115/40] via 172.16.255.6, Serial1/1
C       172.16.255.0/30 is directly connected, Serial1/0
C       172.16.255.4/30 is directly connected, Serial1/1
i L2    172.16.255.8/30 [115/20] via 172.16.255.6, Serial1/1
i L2    172.16.255.12/30 [115/30] via 172.16.255.6, Serial1/1
i L2    172.16.1.0/24 [115/20] via 172.16.255.1, Serial1/0
i L2    172.16.2.0/24 [115/20] via 172.16.255.1, Serial1/0
R2#
但是查看R1的链路数据库会有L1因为Loopback接口为L1,而路由表显示的是直连的,链路数据拓扑会显示L1L2。)
R1#show isis database
Area cisco:
IS-IS Level-1 Link State Database:
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
R1.00-00            * 0x0000000E   0x2CFF        1165              1/0/0
IS-IS Level-2 Link State Database:
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
R1.00-00            * 0x00000010   0x3AFC        877               0/0/0
R2.00-00              0x00000007   0x194D        1095              0/0/0
R3.00-00              0x00000008   0xD183        335               0/0/0
R4.00-00              0x0000000D   0xB1FE        599               0/0/0
Area cisco1:
R1#
R2也将会有L1L2两张表,因为S1/1接口是L1-2类型,会有L1的报文过来:
R2#sh isis database
 
IS-IS Level-1 Link State Database:
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
R2.00-00            * 0x00000007   0xF068        415               1/0/0
R3.00-00              0x00000009   0xD77D        1182              1/0/0
IS-IS Level-2 Link State Database:
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
R1.00-00              0x00000010   0x3AFC        846               0/0/0
R2.00-00            * 0x00000007   0x194D        1068              0/0/0
R3.00-00              0x00000008   0xD183        308               0/0/0
R4.00-00              0x0000000D   0xB1FE        572               0/0/0
R2#
2、下面再来看一下R5的路由,发现有一条默认路由,其原因是:R5的路由类型为L1,它处于Area 49.0003.R4L1-2类型,因此其会接到R4路由器发送的L1类型的默认路由。这有点像ospf 中的完全末节区域。这样做的好处就是减少了路由表的大小。同时也增强了isis 的稳定性。
 
R5#show 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 172.16.255.13 to network 0.0.0.0
 
     172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C       172.16.128.0/24 is directly connected, Loopback0
C       172.16.129.0/24 is directly connected, Loopback1
C       172.16.255.12/30 is directly connected, Serial1/0
i*L1 0.0.0.0/0 [115/10] via 172.16.255.13, Serial1/0
R5#
3、R5只会有L1类型的,因为它路由的本身就是L1,它自己学到的也是R4发送的L1类型的默认路由:
R5#show isis database
 
IS-IS Level-1 Link State Database:
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
R4.00-00              0x0000000D   0xD764        400               1/0/0
R5.00-00            * 0x0000000C   0x55D1        983               0/0/0
R5#
4、为了能够更有效的减小路由表的大小,还可以配置IS-IS的汇总。首先查看R4的路由表,R4有全网的路由,呵呵。有点像ospf 中的ABR
R4#show 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
 
     172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks
i L1    172.16.128.0/24 [115/20] via 172.16.255.14, Serial1/1
i L1    172.16.129.0/24 [115/20] via 172.16.255.14, Serial1/1
i L2    172.16.255.0/30 [115/30] via 172.16.255.9, Serial1/0
i L2    172.16.255.4/30 [115/20] via 172.16.255.9, Serial1/0
C       172.16.255.8/30 is directly connected, Serial1/0
C       172.16.255.12/30 is directly connected, Serial1/1
i L2    172.16.1.0/24 [115/40] via 172.16.255.9, Serial1/0
i L2    172.16.2.0/24 [115/40] via 172.16.255.9, Serial1/0
R4#
5.我要把R1的两条loopback 地址汇总一条,让R4 路由表中L2类型的:172.16.1.0/24 172.16.2.0/24合并为一条:
R1(config)#router isis cisco
R1(config-router)#summary-address 172.16.0.0 255.255.252.0
再次查看一下R4的路由表
R4#show 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
 
     172.16.0.0/16 is variably subnetted, 7 subnets, 3 masks
i L1    172.16.128.0/24 [115/20] via 172.16.255.14, Serial1/1
i L1    172.16.129.0/24 [115/20] via 172.16.255.14, Serial1/1
i L2    172.16.255.0/30 [115/30] via 172.16.255.9, Serial1/0
i L2    172.16.255.4/30 [115/20] via 172.16.255.9, Serial1/0
C       172.16.255.8/30 is directly connected, Serial1/0
C       172.16.255.12/30 is directly connected, Serial1/1
i L2    172.16.0.0/22 [115/40] via 172.16.255.9, Serial1/0
R4#
合并为172.16.0.0/22 一条路由了。这样我们可以利用汇总路由来精简路由表,有效地提高路由器的稳定性。