实验目的:

配置缺省路由

观察 ATT

配置过程:

注意 Level12 ATT 位,如果 ATT 位为 1 的话表示可以通过自己到达 level 2 区域;可以向 level 1 广播一条缺省路由。

Level 2only 也可以广播一条缺省路由,用命令 default-information originate 配置

首先我们在 D 上观察一下路由表,可以发现有条缺省路由

A路由器配置为levle-1

Router isis

Is-type levle-1

Router_D#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP

i - IS-IS, 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.2.2.1 to network 0.0.0.0

i L1 192.168.12.0/24 [115/20] via 10.2.2.1, Serial1

C 192.168.31.0/24 is directly connected, Loopback0

172.16.0.0/30 is subnetted, 1 subnets

i L1 172.16.1.0 [115/30] via 10.2.2.1, Serial1

i L1 192.168.11.0/24 [115/20] via 10.2.2.1, Serial1

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

i L1 10.3.3.0/24 [115/20] via 10.2.2.1, Serial1

C 10.2.2.0/30 is directly connected, Serial1

i L1 192.168.1.0/24 [115/10] via 10.2.2.1, Serial1

i L1 192.168.2.0/24 [115/10] via 10.2.2.1, Serial1

C 192.168.32.0/24 is directly connected, Loopback1

i*L1 0.0.0.0/0 [115/20] via 10.2.2.1, Serial1

Router_D#

我们打开路由器 D lsdb,看看谁发的缺省路由

Router_D#show isis database detail

IS-IS Level-1 Link State Database:

LSPID LSP Seq Num LSP Checksum LSP Holdtime

ATT/P/OL

Router_A.00-00 0x0000039A 0xF112 36

0/0/0

Area Address: 49.1234

NLPID: 0x81 0xCC

Hostname: Router_A

IP Address: 192.168.1.1

Metric: 10 IP 10.3.3.0 255.255.255.0

Metric: 0 IP 192.168.1.0 255.255.255.0

Metric: 0 IP 192.168.2.0 255.255.255.0

Metric: 10 IP 10.2.2.0 255.255.255.252

Metric: 10 IS Router_A.03

Metric: 10 IS Router_D.00

Metric: 0 ES Router_A

Router_A.03-00 0x00000398 0x77AA 36 0/0/0

Metric: 0 IS Router_A.00

Metric: 0 IS Router_B.00

Router_B.00-00 0x000003B6 0x7EF3 44 1/0/0

Area Address: 49.1234

NLPID: 0x81 0xCC

Hostname: Router_B

IP Address: 192.168.11.1

Metric: 10 IP 10.3.3.0 255.255.255.0

Metric: 0 IP 192.168.11.0 255.255.255.0

Metric: 0 IP 192.168.12.0 255.255.255.0

Metric: 10 IP 172.16.1.0 255.255.255.252

Metric: 10 IS Router_A.03

Metric: 0 ES Router_B

Router_D.00-00* 0x00000038 0x2B55 44 0/0/0

Area Address: 49.1234

NLPID: 0x81 0xCC

Hostname: Router_D

IP Address: 192.168.31.1

Metric: 0 IP 192.168.31.0 255.255.255.0

Metric: 0 IP 192.168.32.0 255.255.255.0

Metric: 10 IP 10.2.2.0 255.255.255.252

Metric: 10 IS Router_A.00

Metric: 0 ES Router_D

Router_D#

可以看出 B level 1 的唯一出口

也就是说 B 发布的缺省路由

我们在 A 上也检查一下路由表

Router_A#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP

i - IS-IS, 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.3.3.2 to network 0.0.0.0

i L1 192.168.12.0/24 [115/10] via 10.3.3.2, Ethernet0

i L1 192.168.31.0/24 [115/10] via 10.2.2.2, Serial1

172.16.0.0/30 is subnetted, 1 subnets

i L1 172.16.1.0 [115/20] via 10.3.3.2, Ethernet0

i L1 192.168.11.0/24 [115/10] via 10.3.3.2, Ethernet0

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

C 10.2.2.0/30 is directly connected, Serial1

C 10.3.3.0/24 is directly connected, Ethernet0

C 192.168.1.0/24 is directly connected, Loopback0

C 192.168.2.0/24 is directly connected, Loopback1

i L1 192.168.32.0/24 [115/10] via 10.2.2.2, Serial1

i*L1 0.0.0.0/0 [115/10] via 10.3.3.2, Ethernet0

Router_A#

也有一条缺省路由指向 B

下面我们在增加一个路由器 E,这样 level 1 就有了 2 个出口。

Router_E#show isis database

IS-IS Level-1 Link State Database:

LSPID LSP Seq Num LSP Checksum LSP Holdtime ATT/P/OL

Router_A.00-00 0x00000552 0x7CCD 54 0/0/0

Router_A.03-00 0x0000054E 0xB02D 30 0/0/0

Router_B.00-00 0x0000056E 0x09AF 54 1/0/0

Router_D.00-00 0x000001F2 0xB212 52 0/0/0

Router_E.00-00 * 0x00000005 0x1067 54 1/0/0

IS-IS Level-2 Link State Database:

LSPID LSP Seq Num LSP Checksum LSP Holdtime ATT/P/OL

Router_B.00-00 0x00000566 0x9DF1 46 0/0/0

Router_B.03-00 0x0000000A 0x95A4 42 0/0/0

Router_C.00-00 0x0000054B 0xB7D3 46 0/0/0

Router_E.00-00 * 0x00000006 0x1947 45 0/0/0

Router_E#

看出 E 已经收敛齐 lsdb

我们在 A 上检查缺省路由,发现已经有两条了

Router_A#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP

i - IS-IS, 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.3.3.2 to network 0.0.0.0

i L1 192.168.12.0/24 [115/10] via 10.3.3.2, Ethernet0

i L1 192.168.31.0/24 [115/10] via 10.2.2.2, Serial1

172.16.0.0/30 is subnetted, 2 subnets

i L1 172.16.1.0 [115/20] via 10.3.3.2, Ethernet0

i L1 172.16.2.0 [115/20] via 10.3.3.3, Ethernet0

i L1 192.168.11.0/24 [115/10] via 10.3.3.2, Ethernet0

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

C 10.2.2.0/30 is directly connected, Serial1

C 10.3.3.0/24 is directly connected, Ethernet0

C 192.168.1.0/24 is directly connected, Loopback0

C 192.168.2.0/24 is directly connected, Loopback1

i L1 192.168.32.0/24 [115/10] via 10.2.2.2, Serial1

i*L1 0.0.0.0/0 [115/10] via 10.3.3.2, Ethernet0

[115/10] via 10.3.3.3, Ethernet0

Router_A#

A B E 的度量一样,所以可以做负载均衡。

Router_A#show isis database

IS-IS Level-1 Link State Database:

LSPID LSP Seq Num LSP Checksum LSP Holdtime ATT/P/OL

Router_A.00-00 * 0x0000056C 0x48E7 51 0/0/0

Router_A.03-00 * 0x00000569 0x7A48 54 0/0/0

Router_B.00-00 0x00000588 0xD4C9 43 1/0/0

Router_D.00-00 0x0000020B 0x7F2C 30 0/0/0

Router_E.00-00 0x00000006 0x0E68 53 1/0/0

Router_A#

Level 1 2 个出口,B E

我们在 C 上配置一条静态路由,然后注入到 isis

Router_C(config)#ip route 0.0.0.0 0.0.0.0 null 0

Router_C(config)#router isis

Router_C(config-router)#redistribute static ip metric 8 metric-typeexternal level-1-2

Router_C#

我们在 B 上检查有没有这条路由

Router_B#show ip route 0.0.0.0

% Network not in table

Router_B#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP

i - IS-IS, 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

C 192.168.12.0/24 is directly connected, Loopback1

i L1 192.168.31.0/24 [115/20] via 10.3.3.1, Ethernet0

172.16.0.0/30 is subnetted, 2 subnets

C 172.16.1.0 is directly connected, Serial0

i L1 172.16.2.0 [115/20] via 10.3.3.3, Ethernet0

C 192.168.11.0/24 is directly connected, Loopback0

i L2 192.168.21.0/24 [115/10] via 172.16.1.2, Serial0

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

i L1 10.2.2.0/30 [115/20] via 10.3.3.1, Ethernet0

C 10.3.3.0/24 is directly connected, Ethernet0

i L2 192.168.22.0/24 [115/10] via 172.16.1.2, Serial0

i L1 192.168.1.0/24 [115/10] via 10.3.3.1, Ethernet0

i L1 192.168.2.0/24 [115/10] via 10.3.3.1, Ethernet0

i L1 192.168.32.0/24 [115/20] via 10.3.3.1, Ethernet0

Router_B#

B 上没有这个路由,为什么呢?

看看 C lsp 中有没有这条路由

Router_B#show isis database detail Router_C.00-00

IS-IS Level-2 LSP Router_C.00-00

LSPID LSP Seq Num LSP Checksum LSP Holdtime

ATT/P/OL

Router_C.00-00 0x000004AD 0x7B98 31

0/0/0

Area Address: 49.5678

NLPID: 0x81 0xCC

Hostname: Router_C

IP Address: 192.168.21.1

Metric: 10 IS Router_B.00

Metric: 10 IS Router_E.00

Metric: 10 IP 172.16.1.0 255.255.255.252

Metric: 10 IP 172.16.2.0 255.255.255.252

Metric: 0 IP 192.168.21.0 255.255.255.0

Metric: 0 IP 192.168.22.0 255.255.255.0

没有 0.0.0.0/0 路由信息。

我们在 C 上在建立一条静态路由

Router_C(config)#ip route 8.0.0.0 255.0.0.0 null 0

Router_C#

B 上看看这条路由

Router_B#show ip route 8.0.0.0

Routing entry for 8.0.0.0/8

Known via "isis", distance 115, metric 146, type level-2

Redistributing via isis

Last update from 172.16.1.2 on Serial0, 00:00:43 ago

Routing Descriptor Blocks:

* 172.16.1.2, from 192.168.21.1, via Serial0

Route metric is 146, traffic share count is 1

Router_B#show ip route 0.0.0.0

% Network not in table

8.0.0.0 的路由,可还是没有 0.0.0.0 路由,为什么呢?

因为路由器 C 不能把 0/0 的静态路由发进 isis

只能通过下面的命令配置

Router_C(config)#router isis

Router_C(config-router)#default-information originate

Router_C(config-router)#^Z

Router_C#

B 上查看路由表

Router_B#show ip route

………………..

i L1 192.168.32.0/24 [115/20] via 10.3.3.1, Ethernet0

i*L2 0.0.0.0/0 [115/10] via 172.16.1.2, Serial0

Router_B#show ip route 0.0.0.0

Routing entry for 0.0.0.0/0, supernet

Known via "isis", distance 115, metric 10, candidate default path,

type level-2

Redistributing via isis

Last update from 172.16.1.2 on Serial0, 00:05:54 ago

Routing Descriptor Blocks:

* 172.16.1.2, from 192.168.21.1, via Serial0

Route metric is 10, traffic share count is 1

Router_B#show isis database detail Router_C.00-00

IS-IS Level-2 LSP Router_C.00-00

LSPID LSP Seq Num LSP Checksum LSP Holdtime ATT/P/OL

Router_C.00-00 0x0000052D 0x1CE9 38 0/0/0

Area Address: 49.5678

NLPID: 0x81 0xCC

Hostname: Router_C

IP Address: 192.168.21.1

Metric: 10 IS Router_B.00

Metric: 10 IS Router_E.00

Metric: 0 IP 0.0.0.0 0.0.0.0

Metric: 10 IP 172.16.1.0 255.255.255.252

Metric: 10 IP 172.16.2.0 255.255.255.252

Metric: 0 IP 192.168.21.0 255.255.255.0

Metric: 0 IP 192.168.22.0 255.255.255.0

Router_B#

这次有了缺省路由了