在R2上查看ISIS的LSDB:
[R2]dis isis lsdb
Database information for ISIS(1)
--------------------------------
Level-1 Link State Database
LSPID Seq Num Checksum Holdtime Length ATT/P/OL
-------------------------------------------------------------------------------
0000.0000.0001.00-00 0x00000003 0xc428 617 70 0/0/0
0000.0000.0002.00-00* 0x00000006 0x44b7 693 86 1/0/0
0000.0000.0002.01-00* 0x00000001 0xa4e5 637 55 0/0/0
Total LSP(s): 3
*(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* 0x00000007 0x52af 693 86 0/0/0
0000.0000.0002.02-00* 0x00000001 0xd5b1 673 55 0/0/0
0000.0000.0003.00-00 0x00000005 0xe73b 1173 86 0/0/0
Total LSP(s): 3
*(In TLV)-Leaking Route, *(By LSPID)-Self LSP, +-Self LSP(Extended),
ATT-Attached, P-Partition, OL-Overload
[R2]
#发现产生了一条ATT置位的Level-1的LSP
#R1,R4收到后会在本地产生一条默认路由指向R2
查看R1和R4的ISIS路由表:
[R1]dis ip routing-table protocol isis
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : ISIS
Destinations : 3 Routes : 4
ISIS routing table status :
Destinations : 3 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 ISIS-L1 15 10 D 10.1.12.2 GigabitEthernet
0/0/0
10.1.23.0/24 ISIS-L1 15 20 D 10.1.12.2 GigabitEthernet
0/0/0
10.1.24.0/24 ISIS-L1 15 20 D 10.1.12.2 GigabitEthernet
0/0/0
ISIS-L1 15 20 D 10.1.14.4 GigabitEthernet
0/0/1
ISIS routing table status :
Destinations : 0 Routes : 0
[R1]
------------------------------------------------------------------------------
[R4]dis ip routing-table protocol isis
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : ISIS
Destinations : 3 Routes : 4
ISIS routing table status :
Destinations : 3 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 ISIS-L1 15 60 D 10.1.24.2 GigabitEthernet
0/0/0
10.1.12.0/24 ISIS-L1 15 20 D 10.1.14.1 GigabitEthernet
0/0/1
ISIS-L1 15 20 D 10.1.24.2 GigabitEthernet
0/0/0
10.1.23.0/24 ISIS-L1 15 20 D 10.1.24.2 GigabitEthernet
0/0/0
ISIS routing table status :
Destinations : 0 Routes : 0
[R4]
#我们发现在R1上访问是没问题的,但是在R4通过默认路由访问的话,COST为60,那儿就会出现次优路径,明显通过R1到达R2会更优,所以我们需要在R2上路由泄露,将Level-2路由泄露到Level-1区域内
#因为Level-1路由默认是泄露到Level-2区域内的,所以如果我们在将Level-2路由泄露到Level-1区域,那么不就等于双向导入了吗,这样不就会产生环路了吗,所以我们就通过LSP的UP/DOWN置位完美的解决了这个问题
在R2上将Level-2路由泄露到Level-1区域,并查看R4的ISIS路由表:
[R4]dis ip routing-table protocol isis
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : ISIS
Destinations : 4 Routes : 4
ISIS routing table status :
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 ISIS-L1 15 20 D 10.1.14.1 GigabitEthernet
0/0/1
3.3.3.3/32 ISIS-L1 15 30 D 10.1.14.1 GigabitEthernet
0/0/1
10.1.12.0/24 ISIS-L1 15 20 D 10.1.14.1 GigabitEthernet
0/0/1
10.1.23.0/24 ISIS-L1 15 30 D 10.1.14.1 GigabitEthernet
0/0/1
ISIS routing table status :
Destinations : 0 Routes : 0
[R4]
#发现已经存在Level-2的明细路由,而且下一跳为R1,所以就解决了次优路径的问题,而且因为明细路由的掩码较长,所以根据路由表匹配原则,会选择掩码长的,不会选择通过默认路由访问。
在R1上查看ISIS的初始路由表:
[R1]dis isis route
Route information for ISIS(1)
-----------------------------
ISIS(1) Level-1 Forwarding Table
--------------------------------
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags
-------------------------------------------------------------------------------
0.0.0.0/0 10 NULL GE0/0/0 10.1.12.2 A/-/-/-
10.1.24.0/24 70 NULL GE0/0/0 10.1.12.2 A/-/-/-
10.1.14.0/24 10 NULL GE0/0/1 Direct D/-/L/-
3.3.3.3/32 20 NULL GE0/0/0 10.1.12.2 A/-/-/U
10.1.23.0/24 20 NULL GE0/0/0 10.1.12.2 A/-/-/-
10.1.12.0/24 10 NULL GE0/0/0 Direct D/-/L/-
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,
U-Up/Down Bit Set
[R1]
#发现Level-2泄露到Level-1的路由3.3.3.3的falgs up/down置位了,
#将Level-2的路由泄露进Level-1时,会将LSP 的up/down置位,那么在进行Level-1泄露进Level-2,Level-1-2是不会接收up/down置位的LSP
#对于up/down置位的LSP,Level-1-2是不会接收的。
抓包分析:
发现发送的3.3.3.3的 down置位,因为所有的LSP up/down都会置位
查看R2的ISIS的初始路由表:
[R2]dis isis route
Route information for ISIS(1)
-----------------------------
ISIS(1) Level-1 Forwarding Table
--------------------------------
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags
-------------------------------------------------------------------------------
10.1.24.0/24 60 NULL GE0/0/2 Direct D/-/L/-
10.1.14.0/24 20 NULL GE0/0/0 10.1.12.1 A/-/L/-
10.1.23.0/24 10 NULL GE0/0/1 Direct D/-/L/-
10.1.12.0/24 10 NULL GE0/0/0 Direct D/-/L/-
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,
U-Up/Down Bit Set
ISIS(1) Level-2 Forwarding Table
--------------------------------
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags
-------------------------------------------------------------------------------
10.1.24.0/24 60 NULL GE0/0/2 Direct D/-/L/-
3.3.3.3/32 10 NULL GE0/0/1 10.1.23.3 A/-/L/-
10.1.23.0/24 10 NULL GE0/0/1 Direct D/-/L/-
10.1.12.0/24 10 NULL GE0/0/0 Direct D/-/L/-
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,
U-Up/Down Bit Set
[R2]
#发现在L2的L1的路由表里面是不会接收up/down置位的LSP的,这就到达了一个防环的作用