1. 程式人生 > 實用技巧 >RIP路由彙總

RIP路由彙總

RIP路由彙總

拓撲圖:

IP地址資訊:

部門 有效地址 網路號 廣播地址 子網掩碼
PC1 PC1:192.168.40.1--192.168.40.30 192.168.40.0 192.168.40.31 255.255.255.224 /27
Pc2 192.168.40.33 --192.168.40.62 192.168.40.32 192.168.40.63 255.255.255.224 /27
Pc3 192.168.40.65--192.168.40.94 192.168.40.64 192.168.40.95
255.255.255.224 /27
Pc4 192.168.40.97--192.168.40.110 192.168.40.96 192.168.40.111 255.255.255.240 /28
R1<===>R5 192.168.40.129 --192.168.40.130 255.255.255.252 /30
R2<===>R5 192.168.40.133 --192.168.40.134 255.255.255.252 /30
R3<===>R5 192.168.40.137 --192.168.40.138
255.255.255.252 /30
R4<===>R5 192.168.40.141 --192.168.40.142 255.255.255.252 /30
R1>en R1#conf t R1(config)#line console 0 R1(config-line)#pass 12 R1(config-line)#pass 123 R1(config-line)#login R1(config-line)#exit R1(config)#line vty 0 4 R1(config-line)#pass 123 R1(config-line)#login //
路由基本配置 R1(config-line)#exit R1(config)#en R1(config)#enable secret 123 R1(config)#int f1/0 R1(config-if)#ip add 192.168.40.1 255.255.255.224 R1(config-if)#no shut R1(config-if)#exit R1(config)#int s0/0 R1(config-if)#clock rate 64000 R1(config-if)#ip add 192.168.40.129 255.255.255.252 R1(config-if)#no shut R1(config-if)# -------------------------------------------------------------------- R1(config)#service dhcp R1(config)#no ip dhcp conflict logging R1(config)#ip dhcp pool CNC R1(dhcp-config)#network 192.168.40.0 /27 R1(dhcp-config)#default-router 192.168.40.1 //配置DHCP服務 R1(dhcp-config)#domain-name 123.cn R1(dhcp-config)#dns-server 202.102.224.68 R1(dhcp-config)#lease infinite ------------------------------------------------------------------------ R1(dhcp-config)#exit ------------------------------------------------------------------------ R1(config)#router rip R1(config-router)#ver 2 R1(config-router)#net 192.168.40.0 //配置RIPv2協議 並取消自動彙總 R1(config-router)#net 192.168.40.0 R1(config-router)#no auto-summary R1(config-router)#end ----------------------------------------------------------------------------- ...............................省略路由基本配置 ----------------------------------------------------------------------------- R2(config)#router rip R2(config-router)#ver 2 R2(config-router)#no auto-summary R2(config-router)#net 192.168.40.0 //配置RIPv2協議 並取消自動彙總 R2(config-router)#net 192.168.40.0 R2(config-router)# -------------------------------------------------------------------------------- R3>en R3#conf t Enter configuration commands, one per line.End with CNTL/Z. R3(config)#line console 0 R3(config-line)#pass 123 R3(config-line)#login R3(config-line)#exit R3(config)#line vty 0 4 R3(config-line)#pass 123 R3(config-line)#login R3(config-line)#exit R3(config)#enable secret 123 R3(config)#int f1/0 R3(config-if)#ip add 192.168.40.65 255.255.255.224 R3(config-if)#no shut R3(config-if)#exit R3(config)#int s0/0 R3(config-if)#clock rate 64000 R3(config-if)#ip add 192.168.40.137 255.255.255.252 R3(config-if)#no shut R3(config-if)#end -------------------------------------------------------------------------- R3(config)#router rip R3(config-router)#ver 2 R3(config-router)#no au R3(config-router)#no auto-summary R3(config-router)#net 192.168.40.0 //配置RIPv2協議 並取消自動彙總 R3(config-router)#net 192.168.40.0 R3(config-router)# ---------------------------------------------------------------------- R4>en R4#conf t Enter configuration commands, one per line.End with CNTL/Z. R4(config)#line console 0 R4(config-line)#pass 123 R4(config-line)#login R4(config-line)#exit R4(config)#line vty 0 4 R4(config-line)#pass 123 R4(config-line)#login R4(config-line)#exit R4(config)#enable secret 123 R4(config)#int f1/0 R4(config-if)#ip add 192.168.40.141 255.255.255.224 R4(config-if)#no shut R4(config-if)#exit R4(config-if)#int f1/0 R4(config-if)#ip add 192.168.40.97 255.255.255.224 R4(config-if)#no shut R4(config-if)#int s0/0 R4(config-if)#clock rate 64000 R4(config-if)#ip add 192.168.40.141 255.255.255.252 R4(config-if)#no shut ------------------------------------------------------------------------- R4(config)#router rip R4(config-router)#ver 2 R4(config-router)#no auto R4(config-router)#no auto-summary R4(config-router)#net 192.168.40.0 //配置RIPv2協議 並取消自動彙總 R4(config-router)#net 192.168.40.0 R4(config-router)# ----------------------------------------------------------------------- R5(config)#no router rip R5(config)#router rip R5(config-router)#ver 2 R5(config-router)#no auto-summary R5(config-router)#net 192.168.40.0 R5(config-router)#net 192.168.40.0 R5(config-router)#net 192.168.40.0 R5(config-router)#net 192.168.40.0 R5(config-router)#net 10.10.10.0 R5(config-router)#exit R5(config-if)#ip summary-address rip 192.168.40.0 255.255.255.0//手動彙總到192.168.40.0 R5(config-if)# ---------------------------------------------------------------------------------------------- R6(config)#router rip R6(config-router)#ver 2 R6(config-router)#no auto R6(config-router)#no auto-summary R6(config-router)#net 10.10.10.0 R6(config-router)#net 192.168.1.0 R6(config-router)#end ---------------------------------------------------------------------------------------------- R6#show ip route Codes: C - connected, S - static, 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 i - IS-IS, su - IS-IS summary, 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 //這是在沒有彙總情況下R6的路由表,詳細記錄了所有網路路由資訊 192.168.40.0/24 is variably subnetted, 8 subnets, 2 masks R 192.168.40.64/27 [120/2] via 10.10.10.1, 00:00:24, Serial1/0 R 192.168.40.96/27 [120/2] via 10.10.10.1, 00:00:24, Serial1/0 R 192.168.40.0/27 [120/2] via 10.10.10.1, 00:00:24, Serial1/0 R 192.168.40.32/27 [120/2] via 10.10.10.1, 00:00:24, Serial1/0 R 192.168.40.128/30 [120/1] via 10.10.10.1, 00:00:24, Serial1/0 R 192.168.40.132/30 [120/1] via 10.10.10.1, 00:00:24, Serial1/0 R 192.168.40.136/30 [120/1] via 10.10.10.1, 00:00:24, Serial1/0 R 192.168.40.140/30 [120/1] via 10.10.10.1, 00:00:24, Serial1/0 10.0.0.0/30 is subnetted, 1 subnets C 10.10.10.0 is directly connected, Serial1/0 C 192.168.1.0/24 is directly connected, FastEthernet0/0 ---------------------------------------------------------------------------------------------------------------- R6#show ip route Codes: C - connected, S - static, 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 i - IS-IS, su - IS-IS summary, 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 //這是彙總後的路由資訊。 R 192.168.40.0/24 [120/1] via 10.10.10.1, 00:00:28, Serial1/0 10.0.0.0/30 is subnetted, 1 subnets C 10.10.10.0 is directly connected, Serial1/0 C 192.168.1.0/24 is directly connected, FastEthernet0/0 R6# ------------------------------------------------------------------------------------------------------------------- 通過本實驗說明了一個問題,那就是子網劃分後的網路問題。那就是會增加核心路由的路由表。 路由資訊增多,導致查詢路由資訊慢,從而影響網路整體效能。解決這樣的問題就是彙總,將劃分過的子網綜合到一個網路IP地址。