實驗目的:redis
配置缺省路由負載均衡
觀察 ATT 位oop
配置過程:spa
注意 Level1-2 的 ATT 位,若是 ATT 位爲 1 的話表示能夠經過本身到達 level 2 區域;能夠向 level 1 廣播一條缺省路由。orm
Level 2-only 也能夠廣播一條缺省路由,用命令 default-information originate 配置router
首先咱們在 D 上觀察一下路由表,能夠發現有條缺省路由blog
把A路由器配置爲levle-1ip
Router isis路由
Is-type levle-1io
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#
此次有了缺省路由了