Technical documentation
发布日期:2022-06-07 浏览次数:4329 来源:崔志鹏
HCIE Datacom怎么学ISIS开销值metric类型详解
HCIE Datacom怎么学?联系WOLFLAB网站客服,获取免费学习资料
1、narrow:接口可以配置的cost:1-63,路由计算的最大cost值1023,默认就是narrow;
2、wide:接口可以配置的cost:24bit,1-16777214,路由计算的最大cost,32bit,适用于大型网络;
注意:narrow metric如果超过1023的路由我也是接收的,但是即便是metric是2000,我也只能给其设置成1023;
narrow类型下使用的TLV:
128号TLV(IP Internal Reachability TLV):用来携带路由域内的IS-IS路由信息。
130号TLV(IP External Reachability TLV):用来携带路由域外的IS-IS路由信息。
2号TLV(IS Neighbors TLV):用来携带邻居信息。
wide类型下使用的TLV:
135号TLV(Extended IP Reachability TLV):用来替换原有的IP reachability TLV,携带IS-IS路由信息,它扩展了路由开销值的范围,并可以携带sub TLV。
22号TLV(IS Extended Neighbors TLV):用来携带邻居信息。
①narrow:指定IS-IS设备所有接口只能接收和发送开销类型为narrow的路由。
Narrow模式下路由的开销值取值范围为1~63的整数。
②wide:指定IS-IS设备所有接口只能接收和发送开销类型为wide的路由。
wide模式下路由的开销值取值范围为1~16777215的整数。
③wide-compatible:指定IS-IS设备所有接口可以接收开销类型为narrow和wide的路由,但却只发送开销类型为wide的路由。
④narrow-compatible:指定IS-IS设备所有接口可以接收开销类型为narrow和wide的路由,但却只发送开销类型为narrow的路由。
⑤compatible:指定IS-IS设备所有接口可以接收和发送开销类型为narrow和wide的路由。
不同开销类型接收和发送IS-IS信息的类型不同。
开销类型 | 接收 | 发送 |
narrow | narrow | narrow |
narrow-compatible | narrow&wide | narrow |
compatible | narrow&wide | narrow&wide |
wide-compatible | narrow&wide | wide |
wide | wide | wide |
说明:
当配置开销类型为compatible的时候,会按照narrow类型和wide类型分别发送一份信息。
wide类型下的IS-IS和narrow类型下的IS-IS不可实现互通。如果需要互通,就必须设置成一致的开销类型,让网络上所有路由器都可以接收其他路由器发的所有报文。
HCIE Datacom实验:
@R1/R2/R3属于区域49.0123,R4/R5属于区域49.0045;
@R1是L1,R4/R5是L2,R2/R3是L1/2;
@R2的g0/0/0接口是L1,g0/0/1接口是L2;
@R3的g0/0/2接口是L1,g0/0/1接口是L2;
@R2和R3没做路由泄露;
@R1上
ip route-static 192.168.1.0 255.255.255.0 NULL0
isis 1
is-level level-1
cost-style wide
network-entity 49.0123.0000.0000.0001.00
import-route static level-1
我怎么在报文这个层面去判断一台路由器是narrow还是wide呢?
根据发送LSP的TLV去判断
如果一台设备是wide metric,那么此设备通告的LSP中内部路由还是外部路由都是用135 TLV去携带;
此时查看R1的LSDB:
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0001.00-00* 0x00000022 0x896e 1119 101 0/0/0
0000.0000.0001.00-01* 0x00000001 0x41a8 1186 37 0/0/0
0000.0000.0001.01-00* 0x00000018 0x283e 1119 54 0/0/0
0000.0000.0001.02-00* 0x00000013 0x4227 1119 54 0/0/0
0000.0000.0002.00-00 0x0000004d 0xf471 872 74 1/0/0
0000.0000.0003.00-00 0x0000001c 0x482 1030 74 1/0/0
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0001.00-00* 0x00000022 0x896e 1018 101 0/0/0
SOURCE 0000.0000.0001.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.1
INTF ADDR 1.1.13.1
INTF ADDR 1.1.1.1
+NBR ID 0000.0000.0001.02 COST: 10
+NBR ID 0000.0000.0001.01 COST: 10
+IP-Extended 1.1.12.0 255.255.255.0 COST: 10
+IP-Extended 1.1.13.0 255.255.255.0 COST: 10
+IP-Extended 1.1.1.1 255.255.255.255 COST: 0
0000.0000.0001.00-01* 0x00000001 0x41a8 1085 37 0/0/0
SOURCE 0000.0000.0001.00
+IP-Extended 192.168.1.0 255.255.255.0 COST: 0
0000.0000.0001.01-00* 0x00000018 0x283e 1018 54 0/0/0
SOURCE 0000.0000.0001.01
NLPID IPV4
+NBR ID 0000.0000.0001.00 COST: 0
+NBR ID 0000.0000.0002.00 COST: 0
0000.0000.0001.02-00* 0x00000013 0x4227 1018 54 0/0/0
SOURCE 0000.0000.0001.02
NLPID IPV4
+NBR ID 0000.0000.0001.00 COST: 0
+NBR ID 0000.0000.0003.00 COST: 0
所有带+的路由信息表示采用135 TLV去通告的,所有带+的TOP信息表示采用22 TLV去描述的;
R1通告的外部路由:
Extended IP Reachability (t=135, l=8) //使用135 TLV携带,跟narrow metric报文结构就不太一致了
Type: 135
Length: 8
Ext. IP Reachability: 192.168.1.0/24
Metric: 0
0... .... = Distribution: Up
.0.. .... = Sub-TLV: No
..01 1000 = Prefix Length: 24
IPv4 prefix: 192.168.1.0
no sub-TLVs present
R1通告的直连路由:
Extended IP Reachability (t=135, l=25) //内部路由也采用135 TLV携带
Type: 135
Length: 25
Ext. IP Reachability: 1.1.12.0/24
Ext. IP Reachability: 1.1.13.0/24
Ext. IP Reachability: 1.1.1.1/32
Metric: 0
0... .... = Distribution: Up
.0.. .... = Sub-TLV: No
..10 0000 = Prefix Length: 32
IPv4 prefix: 1.1.1.1
no sub-TLVs present
R1作为伪节点描述TOP信息:
Extended IS reachability (t=22, l=22) //使用22 TLV进行描述
Type: 22
Length: 22
IS Neighbor: 0000.0000.0001.00
IS neighbor ID: 0000.0000.0001.00
Metric: 0
SubCLV Length: 0 (no sub-TLVs present)
IS Neighbor: 0000.0000.0002.00
IS neighbor ID: 0000.0000.0002.00
Metric: 0
SubCLV Length: 0 (no sub-TLVs present)
R1作为伪节点描述TOP信息:
Extended IS reachability (t=22, l=22) //使用22 TLV进行描述
Type: 22
Length: 22
IS Neighbor: 0000.0000.0001.00
IS neighbor ID: 0000.0000.0001.00
Metric: 0
SubCLV Length: 0 (no sub-TLVs present)
IS Neighbor: 0000.0000.0003.00
IS neighbor ID: 0000.0000.0003.00
Metric: 0
SubCLV Length: 0 (no sub-TLVs present)
问题一:既然针对内部和外部路由都采用135 TLV去携带,那么其他的路由收到后还能像之前narrow metric时区分内部和外部路由了呢?
不能
问题二:现在只有R1是wide,其他设备都是narrow,那么R2能否将R1传递过来的LSP原封不动的加入自己的LSDB呢?
可以,R2上可以看到R1通告的4条LSP,跟在R1上看到的L1 的LSP一模一样;
问题三:如果R2可以将R1传递过来的LSP完整的加入自己的LSDB,那么R2能否运行SPF算法计算出R1的路由呢?
R2的路由表如下:
1.1.13.0/24 ISIS-L2 15 40 D 1.1.24.4 GigabitEthernet0/0/1
1.1.35.0/24 ISIS-L2 15 30 D 1.1.24.4 GigabitEthernet0/0/1
1.1.45.0/24 ISIS-L2 15 20 D 1.1.24.4 GigabitEthernet0/0/1
4.4.4.4/32 ISIS-L2 15 10 D 1.1.24.4 GigabitEthernet0/0/1
5.5.5.5/32 ISIS-L2 15 20 D 1.1.24.4 GigabitEthernet0/0/1
不能,一条L1的路由都看不到;
问题四:既然R2的LSDB是完整的,那么R2是否会将R1通告过来的L1 LSP作为自己的直连叶子,装载到骨干区域的L2 的LSDB中呢?
不能
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0002.00-00* 0x00000051 0xec75 477 74 1/0/0
SOURCE 0000.0000.0002.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.2
INTF ADDR 1.1.24.2
NBR ID 0000.0000.0001.01 COST: 10
IP-Internal 1.1.12.0 255.255.255.0 COST: 10
Total LSP(s): 1
*(In TLV)-Leaking Route, *(By LSPID)-Self LSP, +-Self LSP(Extended),
ATT-Attached, P-Partition, OL-Overload
Level-2 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0002.00-00* 0x0000004e 0x4b6c 477 86 0/0/0
SOURCE 0000.0000.0002.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.2
INTF ADDR 1.1.24.2
NBR ID 0000.0000.0004.02 COST: 10
IP-Internal 1.1.12.0 255.255.255.0 COST: 10
IP-Internal 1.1.24.0 255.255.255.0 COST: 10
问题五:为什么不能呢?
在SPF树上如果发现自身邻居节点的cost-style和自身接收的不一致,就不会沿着该节点继续向下进行SPF的计算;
问题六:如果将R2改成cost-style narrow-compatible,能否学到R1通告的路由?
可以
1.1.1.1/32 ISIS-L1 15 10 D 1.1.12.1 GigabitEthernet0/0/0
1.1.13.0/24 ISIS-L1 15 20 D 1.1.12.1 GigabitEthernet0/0/0
1.1.35.0/24 ISIS-L2 15 30 D 1.1.24.4 GigabitEthernet0/0/1
1.1.45.0/24 ISIS-L2 15 20 D 1.1.24.4 GigabitEthernet0/0/1
4.4.4.4/32 ISIS-L2 15 10 D 1.1.24.4 GigabitEthernet0/0/1
5.5.5.5/32 ISIS-L2 15 20 D 1.1.24.4 GigabitEthernet0/0/1
192.168.1.0/24 ISIS-L1 15 10 D 1.1.12.1 GigabitEthernet0/0/0
问题七:此时R2如何描述自己的实节点LSP呢?
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0002.00-00* 0x00000055 0xe479 1070 74 1/0/0
SOURCE 0000.0000.0002.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.2
INTF ADDR 1.1.24.2
NBR ID 0000.0000.0001.01 COST: 10
IP-Internal 1.1.12.0 255.255.255.0 COST: 10
Total LSP(s): 1
*(In TLV)-Leaking Route, *(By LSPID)-Self LSP, +-Self LSP(Extended),
ATT-Attached, P-Partition, OL-Overload
Level-2 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0002.00-00* 0x00000053 0xf370 1072 122 0/0/0
SOURCE 0000.0000.0002.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.2
INTF ADDR 1.1.24.2
NBR ID 0000.0000.0004.02 COST: 10
IP-Internal 1.1.12.0 255.255.255.0 COST: 10
IP-Internal 1.1.24.0 255.255.255.0 COST: 10
IP-Internal 1.1.1.1 255.255.255.255 COST: 10
IP-Internal 1.1.13.0 255.255.255.0 COST: 20
IP-Internal 192.168.1.0 255.255.255.0 COST: 10
注意:由此可见R1是wide,R2是narrow-compatible,R2并不知道192.168.1.0/24是一条外部路由;
问题八:如果将R2的cost-type也改成wide,此时R2能否如何描述自己的实节点LSP(R2能否区分内部和外部路由)?
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0002.00-00* 0x00000057 0x1227 1178 69 0/0/0
SOURCE 0000.0000.0002.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.2
INTF ADDR 1.1.24.2
+NBR ID 0000.0000.0001.01 COST: 10
+IP-Extended 1.1.12.0 255.255.255.0 COST: 10
Total LSP(s): 1
*(In TLV)-Leaking Route, *(By LSPID)-Self LSP, +-Self LSP(Extended),
ATT-Attached, P-Partition, OL-Overload
Level-2 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0002.00-00* 0x00000056 0xca18 1183 102 0/0/0
SOURCE 0000.0000.0002.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.2
INTF ADDR 1.1.24.2
+NBR ID 0000.0000.0004.02 COST: 10
+IP-Extended 1.1.12.0 255.255.255.0 COST: 10
+IP-Extended 1.1.24.0 255.255.255.0 COST: 10
+IP-Extended 1.1.1.1 255.255.255.255 COST: 10
+IP-Extended 1.1.13.0 255.255.255.0 COST: 20
+IP-Extended 192.168.1.0 255.255.255.0 COST: 10
所有的路由和TOP信息在LSDB中都显示+,采用135 TLV和22 TLV去描述,此时R2仍然无法区分内部和外部路由;
问题九:现在R1和R2都是wide,那么R4和R5能否学到R2通告的路由?
不能
R4:
1.1.13.0/24 ISIS-L2 15 30 D 1.1.45.5 GigabitEthernet0/0/0
1.1.35.0/24 ISIS-L2 15 20 D 1.1.45.5 GigabitEthernet0/0/0
5.5.5.5/32 ISIS-L2 15 10 D 1.1.45.5 GigabitEthernet0/0/0
R5:
1.1.13.0/24 ISIS-L2 15 20 D 1.1.35.3 GigabitEthernet0/0/1
1.1.24.0/24 ISIS-L2 15 20 D 1.1.45.4 GigabitEthernet0/0/0
4.4.4.4/32 ISIS-L2 15 10 D 1.1.45.4 GigabitEthernet0/0/0
问题十:项目中或者考试中使用的是narrow还是wide?
Wide
问题十一:为啥?
①Wide metric适用于大型网络;
②只有wide metric才支持打tag;
举例:现在将所有的设备cost-type都改成narrow,现在R1上想针对引入静态路由打TAG,此时在R1通告的LSP里面并未携带TAG信息
isis 1
is-level level-1
network-entity 49.0123.0000.0000.0001.00
import-route static level-1 tag 100
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0001.00-01* 0x00000008 0x1426 1149 41 0/0/0
SOURCE 0000.0000.0001.00
IP-External 192.168.1.0 255.255.255.0 COST: 64
现在将R1的cost-type改成wide,现在R1上想针对引入静态路由打TAG,此时在R1通告的LSP里面就会携带TAG信息
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0001.00-01* 0x00000009 0xe446 1188 44 0/0/0
SOURCE 0000.0000.0001.00
+IP-Extended 192.168.1.0 255.255.255.0 COST: 0 Tag: 100
Ext. IP Reachability: 192.168.1.0/24
Metric: 0
0... .... = Distribution: Up
.1.. .... = Sub-TLV: Yes
..01 1000 = Prefix Length: 24
IPv4 prefix: 192.168.1.0
SubCLV Length: 6
subTLV: 32-bit Administrative Tag (c=1, l=4) //报文当中通过SUB-TLV去携带
Code: 32-bit Administrative Tag (1)
Length: 4
32-Bit Administrative tag: 0x00000064 (100)
还可以针对不同的外部路由打tag,在R1上搞三条外部路由
192.168.1.0/24 tag 100
192.168.2.0/24 tag 200
192.168.3.0/24 tag 300
R1:
ip route-static 192.168.1.0 255.255.255.0 NULL0
ip route-static 192.168.2.0 255.255.255.0 NULL0
ip route-static 192.168.3.0 255.255.255.0 NULL0
route-policy TAG permit node 10
if-match acl 2000
apply tag 100
#
route-policy TAG permit node 20
if-match acl 2001
apply tag 200
#
route-policy TAG permit node 30
isis 1
is-level level-1
cost-style wide
network-entity 49.0123.0000.0000.0001.00
import-route static level-1 tag 300 route-policy TAG
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0001.00-01* 0x0000000f 0x97da 1180 74 0/0/0
SOURCE 0000.0000.0001.00
+IP-Extended 192.168.1.0 255.255.255.0 COST: 0 Tag: 100
+IP-Extended 192.168.2.0 255.255.255.0 COST: 0 Tag: 200
+IP-Extended 192.168.3.0 255.255.255.0 COST: 0 Tag: 300
针对192.168.1.0和2.0设置单独的TAG,其他路由允许引入使用引入时的TAG=300;
问题十二:怎么针对内部路由打tag
R1:
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
isis enable 1
isis tag-value 400
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0001.00-00* 0x00000034 0x9170 1182 108 0/0/0
SOURCE 0000.0000.0001.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.1
INTF ADDR 1.1.13.1
INTF ADDR 1.1.1.1
+NBR ID 0000.0000.0001.01 COST: 10
+NBR ID 0000.0000.0001.02 COST: 10
+IP-Extended 1.1.12.0 255.255.255.0 COST: 10
+IP-Extended 1.1.13.0 255.255.255.0 COST: 10
+IP-Extended 1.1.1.1 255.255.255.255 COST: 0 Tag: 400
问题十二:TAG有什么用?
①双点双向路由引入解决环路和次优;
②针对路由做控制;
现在希望R2只将tag是400的路由装载到L2的LSDB里面
R2:
route-policy TAG permit node 10
if-match tag 400
isis 1
cost-style wide
network-entity 49.0123.0000.0000.0002.00
import-route isis level-1 into level-2 filter-policy route-policy TAG
做之前R2通告的LSP:
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0002.00-00* 0x00000063 0xf933 1157 69 0/0/0
SOURCE 0000.0000.0002.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.2
INTF ADDR 1.1.24.2
+NBR ID 0000.0000.0001.01 COST: 10
+IP-Extended 1.1.12.0 255.255.255.0 COST: 10
Total LSP(s): 1
*(In TLV)-Leaking Route, *(By LSPID)-Self LSP, +-Self LSP(Extended),
ATT-Attached, P-Partition, OL-Overload
Level-2 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0002.00-00* 0x00000065 0x2a48 1160 146 0/0/0
SOURCE 0000.0000.0002.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.2
INTF ADDR 1.1.24.2
+NBR ID 0000.0000.0004.02 COST: 10
+IP-Extended 1.1.12.0 255.255.255.0 COST: 10
+IP-Extended 1.1.24.0 255.255.255.0 COST: 10
+IP-Extended 1.1.1.1 255.255.255.255 COST: 10 Tag: 400
+IP-Extended 1.1.13.0 255.255.255.0 COST: 20
+IP-Extended 192.168.1.0 255.255.255.0 COST: 10 Tag: 100
+IP-Extended 192.168.2.0 255.255.255.0 COST: 10 Tag: 200
+IP-Extended 192.168.3.0 255.255.255.0 COST: 10 Tag: 300
做完之后R2通告的LSP:
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0002.00-00* 0x00000063 0xf933 1047 69 0/0/0
SOURCE 0000.0000.0002.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.2
INTF ADDR 1.1.24.2
+NBR ID 0000.0000.0001.01 COST: 10
+IP-Extended 1.1.12.0 255.255.255.0 COST: 10
Total LSP(s): 1
*(In TLV)-Leaking Route, *(By LSPID)-Self LSP, +-Self LSP(Extended),
ATT-Attached, P-Partition, OL-Overload
Level-2 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0002.00-00* 0x00000066 0xffc6 1193 93 0/0/0
SOURCE 0000.0000.0002.00
NLPID IPV4
AREA ADDR 49.0123
INTF ADDR 1.1.12.2
INTF ADDR 1.1.24.2
+NBR ID 0000.0000.0004.02 COST: 10
+IP-Extended 1.1.12.0 255.255.255.0 COST: 10
+IP-Extended 1.1.24.0 255.255.255.0 COST: 10
+IP-Extended 1.1.1.1 255.255.255.255 COST: 10 Tag: 400
注意:
@发送的是wide或者是narrow,只是针对自己产生的LSP设置成wide或者是narrow,不能去改别人的;
@在SPF树上如果发现自身邻居节点的cost-style和自身接收的不一致,就不会沿着该节点继续向下进行SPF的计算;
@cost-type不一致不会影响邻居关系的建立,但是会影响路由的计算,所以强烈建立全网cost-type保持唯一;
@当配置开销类型为compatible的时候,会按照narrow类型和wide类型分别发送一份信息,也就是128、130、135、2、22TLV都会发送;
@只有wide metric才支持打tag;
问题十三:cost值到底是怎么算的?
@无论是narrow还是wide,默认每一段链路cost就是10,跟带宽没关系;
@无论是narrow还是wide,默认loop0接口网段开销是0;
@针对引入的外部路由存在开销类型分别是external(默认)和internal;针对内部的路由没这说法,就相当于ospf引入外部路由时的type 1和type 2
@如果是wide metric,internal和external没区别,引入时的开销=0+引人时设置的cost(可设可不设);
举例:假设现在所有设备都是wide,垃圾配置拿掉,R1仅引人了一条192.168.1.0/24的外部路由,此时查看R1的实节点LSP:
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0001.00-01* 0x00000012 0x1fb9 1194 37 0/0/0
SOURCE 0000.0000.0001.00
+IP-Extended 192.168.1.0 255.255.255.0 COST: 0
查看R2上针对192.168.1.0/24的路由:
[AR2]dis ip routing-table | include 192.168.1.0
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/24 ISIS-L1 15 10 D 1.1.12.1 GigabitEthernet0/0/0
查看R4上针对192.168.1.0/24的路由:
[AR4]dis ip routing-table | include 192.168.1.0
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 18
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/24 ISIS-L2 15 20 D 1.1.24.2 GigabitEthernet0/0/1
@如果是narrow metric
①external:引入时的开销默认=引人时设置的cost+64;
②internal:引入时的开销默认=0+引人时设置的cost(可设可不设);
举例:假设现在所有设备都是narrow,R1仅引人了一条192.168.1.0/24的外部路由,此时查看R1的实节点LSP:
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0001.00-01* 0x00000001 0x221f 1194 41 0/0/0
SOURCE 0000.0000.0001.00
IP-External 192.168.1.0 255.255.255.0 COST: 64
查看R2的路由表:
[AR2]dis ip routing-table | include 192.168.1.0
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/24 ISIS-L1 15 74 D 1.1.12.1 GigabitEthernet0/0/0
如果R1引入外部路由时将cost-type改成internal,此时R1产生的LSP如下:
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0001.00-01* 0x00000002 0x1f61 1178 41 0/0/0
SOURCE 0000.0000.0001.00
IP-External 192.168.1.0 255.255.255.0 COST: 0
报文中怎样标识internal和external呢?
IP External reachability (t=130, l=12)
Type: 130
Length: 12
IPv4 prefix: 192.168.1.0/24
..00 0000 = Default Metric: 0
.0.. .... = Default Metric IE: Internal
0... .... = Distribution: Up
..00 0000 = Delay Metric: 0
1... .... = Delay Metric: Not Supported
.0.. .... = Delay Metric: Internal
..00 0000 = Expense Metric: 0
1... .... = Expense Metric: Not Supported
.0.. .... = Expense Metric: Internal
..00 0000 = Error Metric: 0
1... .... = Error Metric: Not Supported
.0.. .... = Error Metric: Internal
注意:当开销是wide时,135 TLV并没有设计相应字段去标识,所以当metric类型是wide时,internal和external没区别;
@在narrow metric模式下,internal优于external,不考虑优先级和cost;
R1和R5分别引入一条192.168.1.0/24的路由,R1是internal,R5是external,将R5的g0/0/1接口断掉,此时在R4上观察现象:
R1:
isis 1
is-level level-1
network-entity 49.0123.0000.0000.0001.00
import-route static cost-type internal level-1
R5:
ip route-static 192.168.1.0 255.255.255.0 NULL0 preference 10 //优先级要比15小,否则静态路由在路由表中不生效;
isis 1
is-level level-2
network-entity 49.0045.0000.0000.0004.00
import-route static
此时在R4上看现象:
[AR4]dis ip routing-table | include 192.168.1.0
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 18
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/24 ISIS-L2 15 20 D 1.1.24.2 GigabitEthernet0/0/1
如果将R3的g0/0/1接口的cost改成63,将g0/0/0接口的cost改成1,此时从R5传递过来的192.168.1.0/24 cost=65,从R2传递过来的是 cost=73,但是R4还是会优先选择R2,如果跟R2的邻居关系down了,此时R4才会走R5;
结论总结:
@无论是narrow还是wide,默认每一段链路cost就是10,跟带宽没关系;
@无论是narrow还是wide,默认loop0接口网段开销是0;
@针对引入的外部路由存在开销类型分别是external(默认)和internal;针对内部的路由没这说法,就相当于ospf引入外部路由时的type 1和type 2
@如果是wide metric,internal和external没区别,引入时的开销=0+引人时设置的cost(可设可不设);
@如果是narrow metric
①external:引入时的开销默认=引人时设置的cost+64;
②internal:引入时的开销默认0+引人时设置的cost(可设可不设);
@在narrow metric模式下,internal优于external,不考虑优先级和cost;
问题十四:cost值能否自己去计算?
当使能此功能后,对于某个IS-IS接口来说,如果在接口视图下没有配置开销值,而且在IS-IS视图下也没有配置全局开销值,则此接口的开销由系统自动计算。
当开销类型为wide或wide-compatible时,每个接口的开销值通过下面的公式计算:接口的开销值= (Bandwidth-reference/Link-bandwidth)×10,配置auto-cost enablecompatible命令后每个接口的开销值通过下面的公式计算:接口的开销值= (Bandwidth-reference/Link-bandwidth)。
其中,开销类型通过命令cost-style配置,参考带宽值Bandwidth-reference通过命令bandwidth-reference配置,Link-bandwidth为接口带宽值。
当开销类型为narrow、narrow-compatible或compatible时,各个接口的开销值根据下表来确定。
开销值 | 接口带宽范围 |
60 | 接口带宽≤10Mbit/s |
50 | 10Mbit/s<接口带宽≤100Mbit/s |
40 | 100Mbit/s<接口带宽≤155Mbit/s |
30 | 155Mbit/s<接口带宽≤622Mbit/s |
20 | 622Mbit/s<接口带宽≤2.5Gbit/s |
10 | 2.5Gbit/s<接口带宽 |
HCIE Datacom怎么学?WOLFLAB课程循环开班,可预约免费试听