簡介:IS-IS協議同標準協議OSPF一樣,是一種鏈路狀態動態路由協議,但是它比ospf做了很多優化,減少了路由類型、LSA的泛洪,在現網中的應用也十分的廣泛。
實驗拓撲:
實驗目的:1.在R1—R5上運行IS-IS協議,R1-R6上運行RIPv2協議
2.進行路由重發布,實現R5、R6互通
3.實現域間和外部路由彙總
實驗步驟:1.在R1到R6上做基本配置,以及環回口。(略)
2.運行IS-IS協議和RIP協議
R1(config)#router isis
R1(config-router)#net 49.0001.0001.0001.0001.00 //指定NSAP地址,相當於router ID
R1(config-router)#ex
R1(config)#int range f0/0 ,l0
R1(config-if-range)#ip router isis //進接口後宣告該接口下的網段
R2(config)#router isis
R2(config-router)#net 49.0001.0002.0002.0002.00
R2(config-router)#ex
R2(config)#int range f0/0 -1 ,l0
R2(config-if-range)#ip router isis
R3(config)#router isis
R3(config-router)#net 49.0000.0003.0003.0003.00
R3(config-router)#ex
R3(config)#int range f0/0 -1 ,l0
R3(config-if-range)#ip router isis
R4(config)#router isis
R4(config-router)#net 49.0000.0004.0004.0004.00
R4(config-router)#ex
R4(config)#int range f0/0 -1 ,l0
R4(config-if-range)#ip router isis
R5(config)#router isis
R5(config-router)#net 49.0002.0005.0005.0005.00
R5(config-router)#ex
R5(config)#int range f0/1 ,l0
R5(config-if-range)#ip router isis
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 16.0.0.0
R6#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R6(config)#router rip
R6(config-router)#version 2
R6(config-router)#no auto-summary
R6(config-router)#network 16.0.0.0
R6(config-router)#network 6.6.6.6
可以對IS-IS協議作一些優化,由於ISIS協議路由器默認使用的選擇級別是level 1-2,會同時發送兩種LSP,這是沒有必要的,十分浪費路由資源。
將R1改爲level 1
R1(config)#router isis
R1(config-router)#is-type level-1 //修改路由器的路由選擇級別
將R3,R4改爲level 2
R3(config)#router isis
R3(config-router)#is-type level-2
R4(config)#router isis
R4(config-router)#is-type level-2
將R5的f0/1接口改爲level 2
R5#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R5(config)#int f0/1
R5(config-if)#isis circuit-type level-2-only //修改接口的選擇級別
3.路由重發布
R1(config)#router isis
R1(config-router)#redistribute rip ?
level-1 IS-IS level-1 routes only
level-1-2 IS-IS level-1 and level-2 routes
level-2 IS-IS level-2 routes only
metric Metric for redistributed routes
metric-type OSPF/IS-IS exterior metric type for redistributed routes
route-map Route map reference
<cr>
R1(config-router)#redistribute rip level-1
R1(config-router)#ex
R1(config)#router rip
R1(config-router)#redistribute isis ?
WORD ISO routing area tag
level-1 IS-IS level-1 routes only
level-1-2 IS-IS level-1 and level-2 routes
level-2 IS-IS level-2 routes only
metric Metric for redistributed routes
route-map Route map reference
<cr>
R1(config-router)#redistribute isis level-1 metric 2
查看一下R5的路由表
R5#show ip route
....
34.0.0.0/24 is subnetted, 1 subnets
i L2 34.0.0.0 [115/20] via 45.0.0.4, FastEthernet0/1
16.0.0.0/24 is subnetted, 1 subnets
i L2 16.0.0.0 [115/40] via 45.0.0.4, FastEthernet0/1
1.0.0.0/32 is subnetted, 1 subnets
i L2 1.1.1.1 [115/50] via 45.0.0.4, FastEthernet0/1
2.0.0.0/24 is subnetted, 1 subnets
i L2 2.2.2.0 [115/40] via 45.0.0.4, FastEthernet0/1
3.0.0.0/32 is subnetted, 1 subnets
i L2 3.3.3.3 [115/30] via 45.0.0.4, FastEthernet0/1
4.0.0.0/32 is subnetted, 1 subnets
i L2 4.4.4.4 [115/20] via 45.0.0.4, FastEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
6.0.0.0/32 is subnetted, 1 subnets
i L2 6.6.6.6 [115/40] via 45.0.0.4, FastEthernet0/1
23.0.0.0/24 is subnetted, 1 subnets
i L2 23.0.0.0 [115/30] via 45.0.0.4, FastEthernet0/1
45.0.0.0/24 is subnetted, 1 subnets
C 45.0.0.0 is directly connected, FastEthernet0/1
測試一下R5能否連通R6
R5#p 6.6.6.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 88/122/140 ms
可見,R5已經學習到R6的路由了。
4.域間路由彙總和外部路由彙總
假設在R5上有4條路由,192.168.0.1-192.168.3.1
可以在R5上進行彙總
R5(config)#router isis
R5(config-router)#summary-address 192.168.0.0 255.255.252.0
這時候,在R4上面查看路由表會發現一條彙總路由
R4#show ip r
*Mar 1 01:09:31.227: %SYS-5-CONFIG_I: Configured from console by console
R4#show ip route
....
34.0.0.0/24 is subnetted, 1 subnets
C 34.0.0.0 is directly connected, FastEthernet0/1
16.0.0.0/24 is subnetted, 1 subnets
i L2 16.0.0.0 [115/30] via 34.0.0.3, FastEthernet0/1
1.0.0.0/32 is subnetted, 1 subnets
i L2 1.1.1.1 [115/40] via 34.0.0.3, FastEthernet0/1
2.0.0.0/24 is subnetted, 1 subnets
i L2 2.2.2.0 [115/30] via 34.0.0.3, FastEthernet0/1
3.0.0.0/32 is subnetted, 1 subnets
i L2 3.3.3.3 [115/20] via 34.0.0.3, FastEthernet0/1
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
5.0.0.0/32 is subnetted, 1 subnets
i L2 5.5.5.5 [115/20] via 45.0.0.5, FastEthernet0/0
6.0.0.0/32 is subnetted, 1 subnets
i L2 6.6.6.6 [115/30] via 34.0.0.3, FastEthernet0/1
23.0.0.0/24 is subnetted, 1 subnets
i L2 23.0.0.0 [115/20] via 34.0.0.3, FastEthernet0/1
12.0.0.0/24 is subnetted, 1 subnets
i L2 12.0.0.0 [115/30] via 34.0.0.3, FastEthernet0/1
45.0.0.0/24 is subnetted, 1 subnets
C 45.0.0.0 is directly connected, FastEthernet0/0
i L2 192.168.0.0/22 [115/20] via 45.0.0.5, FastEthernet0/0
這樣可以節省路由器的資源。
同樣的,假設在R6上有4條路由172.16.0.1-172.16.3.1
可以在R1上進行路由彙總
R1(config)#router isis
R1(config-router)#summary-address 172.16.0.0 255.255.252.0 level-1
注意:在對外部路由進行彙總的時候,最後要加上level-x ,否則無效
在R2上查看一下路由彙總是否生效。
R2#show ip route
.....
34.0.0.0/24 is subnetted, 1 subnets
i L2 34.0.0.0 [115/20] via 23.0.0.3, FastEthernet0/0
16.0.0.0/24 is subnetted, 1 subnets
i L1 16.0.0.0 [115/10] via 12.0.0.1, FastEthernet0/1
1.0.0.0/32 is subnetted, 1 subnets
i L1 1.1.1.1 [115/20] via 12.0.0.1, FastEthernet0/1
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
i L2 3.3.3.3 [115/20] via 23.0.0.3, FastEthernet0/0
4.0.0.0/32 is subnetted, 1 subnets
i L2 4.4.4.4 [115/30] via 23.0.0.3, FastEthernet0/0
5.0.0.0/32 is subnetted, 1 subnets
i L2 5.5.5.5 [115/40] via 23.0.0.3, FastEthernet0/0
6.0.0.0/32 is subnetted, 1 subnets
i L1 6.6.6.6 [115/10] via 12.0.0.1, FastEthernet0/1
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, FastEthernet0/0
172.16.0.0/22 is subnetted, 1 subnets
i L1 172.16.0.0 [115/10] via 12.0.0.1, FastEthernet0/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, FastEthernet0/1
45.0.0.0/24 is subnetted, 1 subnets
i L2 45.0.0.0 [115/30] via 23.0.0.3, FastEthernet0/0
i L2 192.168.0.0/22 [115/40] via 23.0.0.3, FastEthernet0/0
彙總完畢,實驗結束