【正文】
Serial0 RIP 協(xié)議啟用后的路由表 r1show 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 E1 OSPF external type 1, E2 OSPF external type 2, E EGP i ISIS, L1 ISIS level1, L2 ISIS level2, * candidate default U peruser static route Gateway of last resort is not set C , Ether0 C , Serial0 R [120/1] via , 00:01:37, Serial0 R [120/1] via , 00:07:21, Serial0 R [120/2] via , 00:05:21, Serial0 2. R2 上的配置: Router Routeren Routerconf t Router(config)host r2 r2(config)int s1 r2(configif)ip add r2(configif)no shutdown r2(configif)exit r2(config)int s0 r2(configif)ip add r2(configif)ip add r2(configif)clock rate 56000 r2(configif)no shutdown r2(configif)exit r2(config)int e0 r2(configif)ip add r2(configif)no shutdown r2(configif)exit r2(config)router rip r2(configrouter) r2(configrouter)^Z r2show 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 E1 OSPF external type 1, E2 OSPF external type 2, E EGP i ISIS, L1 ISIS level1, L2 ISIS level2, * candidate default U peruser static route Gateway of last resort is not set C , Serial1 C , Ether0 C , Serial0 R [120/1] via , 00:09:13, Serial1 R [120/1] via , 00:09:13, Serial0 3. R3 上的配置: Router Routeren Routerconf t Router(config)int s1 Router(configif)ip add Router(configif)no shutdown Router(configif)exit Router(config)int e0 Router(configif)ip add Router(configif)no shutdown Router(configif)exit Router(config)host r3 r3(config) r3(config)router rip r3(configrouter) r3(configrouter)^Z r3show 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 E1 OSPF external type 1, E2 OSPF external type 2, E EGP i ISIS, L1 ISIS level1, L2 ISIS level2, * candidate default U peruser static route Gateway of last resort is not set C , Serial1 C , Ether0 R [120/1] via , 00:05:32, Serial1 R [120/1] via , 00:08:19, Serial1 R [120/1] via , 00:05:32, Serial1 4. 測試: r1 r1ping Protocol [ip]: Target IP address: Repeat count [5]: Datagram size [100]: Timeout in seconds [2]: Extended mands [n]: Type escape sequence to abort. Sending 5, 100byte ICMP Echos to , timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), roundtrip min/avg/max = 1/2/4 ms PC 上的配置為: PC1: IP 為 網(wǎng)關(guān): PC2: IP 為 網(wǎng)關(guān): PC3: IP 為 網(wǎng)關(guān): 實(shí)驗(yàn) 6 路由器的簡單 配置 張錕 一.實(shí)驗(yàn)?zāi)康模? 1) 掌握 IP 的無類路由技術(shù) 2) RIP 路由協(xié)議的 配置過程 3) 環(huán)回口的正確配置 4) Consol 口日志的同步啟用 5) Consol 口日志的級(jí)別設(shè)定 6) 恢復(fù)端口的出廠配置 7) 取消命令行的配置 8) 缺省路由的使用 9) 不同路由器的切換 二. 實(shí)驗(yàn) 實(shí)驗(yàn)拓?fù)洌? 拓?fù)浞治觯? 兩個(gè)路由器相連的網(wǎng)絡(luò)使用了子網(wǎng)掩碼為 30 位的網(wǎng)絡(luò)號(hào) 。 注:在實(shí)驗(yàn)中,我們用 Loopback 口代替 4 臺(tái) PC。 路由器 R1 配置如下: Router en 進(jìn)入特權(quán)模式 Router conf t 進(jìn)入全局配置模式 Router host R1 更改路由器名 R1 (config) int lo1 進(jìn)入了 loopback1 口 R1 (configif) ip add 配置端口 IP R1 (configif) exit R1 (config) int lo2 R1 (configif) ip add R1 (configif) exit R1 (config) int lo3 R1 (configif) ip add R1 (configif) ^Z 直接退之特權(quán)模式 R1 config t R1 (config) int s0/0 配置 S0/0 口 R1 (configif) ip add 配置 IP R1 (configif) clock rate 56000 配置 DCE 端時(shí)鐘 R1 (configif) no shut 啟用端口 R1 (configif) exit R1 (config) router rip 啟用 RIP 路由協(xié)議 R1 (configrouter) 加入直連的網(wǎng)絡(luò)號(hào) R1 (configrouter) R1 (configrouter) R1 (configrouter) ^Z R1 show ip router 察看路由表 路由器 R2配置如下 : Router en Router config t Router (config) host R2 R2 (configif) int s0/1 R2 (configif) ip add R2 (configif) no shut R2 (configif) exit R2 (config) int lo1 R2 (configif) ip add R2 (configif) exit R2 (config) router rip R2 (configrouter) R2 (configrouter) R2 (configrouter) ^Z R2 show ip route 三.實(shí)驗(yàn)結(jié)果: 由圖可見, C 代表直連的兩個(gè)網(wǎng)絡(luò)。 在 R2 上能看到 A 類網(wǎng)絡(luò) 10 的路由原因是因?yàn)?IOS 里缺省有一句話 ip classless,如果使用no ip classless,在 R2上將看不到 A類網(wǎng)絡(luò) 10 的路由,原因是 RIP 是有類路由,會(huì)在邊界也就 R2 的 s0/1 口做自動(dòng)匯總,它會(huì)認(rèn)為 A 類網(wǎng)絡(luò) 10 是自己直連的網(wǎng)絡(luò),雖然從 R1 也能學(xué)到,但那有一跳,因沒有直連路由好而被忽略。在給路由器接口配 IP 地址時(shí),注意 IP 的選用,如本實(shí)驗(yàn)中 。 問題 1: 在輸命令時(shí),經(jīng)常被 CONSOLE 口日志打斷。使用以下命令: R2 (config) line console 0 R2 (configline) no log 0(根據(jù) 0 到 7 值的不同,取消的日志消息級(jí)別也不同 ) 問題 2: 想清空端口的先前配置。 解決: 使用缺省路由。 實(shí)驗(yàn)拓?fù)洌? 路由器 R1 配置如下: Router en 進(jìn)入特權(quán)模式 Router conf t 進(jìn)入全局配置模式 Router host R1 更改路由器名 R1 (config) int lo1 進(jìn)入了 loopback1 口 R1 (configif) ip add R1 (configif) ^Z 直接退之特權(quán)模式 R1 config t R1 (config) int s0 配置 S0 口 R1 (configif) ip add