日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CCNA 配置试验之一 静态路由

發布時間:2025/3/20 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CCNA 配置试验之一 静态路由 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

靜態路由的應用場合

? 一個小型到中型的網絡,而且沒有或只有較小的擴充計劃時。

? 靜態路由要手工輸入,手工管理;管理開銷對于動態路由來說是一個大大的負擔。

靜態路由優缺點

? 優點:

? 1.對路由器CPU沒有管理性開銷

? 2.在路由器間沒有帶寬占用

? 3.增加安全性

? 缺點:

? 1.必須真正了解網絡

? 2.對于新添網絡配置繁瑣

? 3.對于大型網絡工作量巨大

靜態路由的配置

Router(config)#ip route network [mask] {address | interface}[distance] [permanent]
即Router(config)#ip route 目標網段 目標網段的網絡掩碼 直連鄰居的接口IP地址

(直連鄰居的接口IP地址=下一跳的IP地址=網關)

下面我們通過試驗來驗證靜態路由的配置

CCNA試驗我使用的是模擬器

試驗環境如下:

試驗環境說明:

R1的ip地址為 192.168.1.1(S0/0) 網絡掩碼為255.255.255.0

R2的ip地址為 192.168.1.2(S0/0) 192.168.2.1(S0/1) 網絡掩碼為255.255.255.0

R3的ip地址為 192.168.2.2 (S0/1) 192.168.3.1S0/2) 網絡掩碼為255.255.255.0

R4的ip地址為 192.168.3.2(S0/2) 網絡掩碼為255.255.255.0

R1的S0/0端口、R2的S0/1端口、R3的S0/2端口為DCE端

試驗要求:

要求在路由器間配置靜態路由使路由器間相互ping通。實現全網全通。

好了,開始工作

R1

en

conf t

host r1 定義路由器名稱

enable password cisco 定義特權口令

line vty 0 4 定義telne口令

pass cisco

login

exit

int s0/0 定義接口信息

ip addr 192.168.1.1 255.255.255.0

clock rate 64000 設置時鐘頻率

no shut

exit

ip route 192.168.2.0 255.255.255.0 192.168.1.2 在R1中配置靜態路由

ip route 192.168.3.0 255.255.255.0 192.168.1.2

R2

en

conf t

host r2 定義路由器名稱

enable password cisco 定義特權口令

line vty 0 4 定義telne口令

pass cisco

login

exit

int s0/0 定義接口信息

ip addr 192.168.1.2 255.255.255.0

no shut

exit

int s0/1

ip addr 192.168.2.1 255.255.255.0

clock rate 64000 設置時鐘頻率

no shut

exit

ip route 192.168.3.0 255.255.255.0 192.168.2.2 在R2中配置靜態路由

R3

en

conf t

host r3 定義路由器名稱

enable password cisco 定義特權口令

line vty 0 4 定義telne口令

pass cisco

login

exit

int s0/1 定義接口信息

ip addr 192.168.2.2 255.255.255.0

no shut

exit

int s0/2

ip addr 192.168.3.1 255.255.255.0

clock rate 64000 設置時鐘頻率

no shut

exit

ip route 192.168.1.0 255.255.255.0 192.168.2.1 在R3中配置靜態路由

R4

en

conf t

host r4 定義路由器名稱

enable password cisco 定義特權口令

line vty 0 4 定義telne口令

pass cisco

login

exit

int s0/2 定義接口信息

ip addr 192.168.3.2 255.255.255.0

no shut

exit

ip route 192.168.1.0 255.255.255.0 192.168.3.1 在R3中配置靜態路由

ip route 192.168.2.0 255.255.255.0 192.168.3.1

在R1上ping R2 R3 R4 如下圖所示,全網全通啦

如下是在路由器R1 R2 R3 R4 里做出的配置 紅色字體為配置內容

R1

Router>en

Router#conf t

Enter configuration commands, .e per line. End with CNTL/Z.

Router(config)#host r1

r1(config)#enable password cisco

r1(config)#line vty 0 4

r1(config-line)#pass cisco

r1(config-line)#login

r1(config-line)#exit

r1(config)#int s0/0

r1(config-if)#ip addr 192.168.1.1 255.255.255.0

r1(config-if)#clock rate 64000

r1(config-if)#no shut

r1(config-if)#exit

*Mar 1 00:05:14.311: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up

*Mar 1 00:05:15.311: %LINEPROTO-5-UPDOWN: Line protocol . Interface Serial0/0,

changed state to up

r1(config)#ip route 192.168.2.0 255.255.255.0 192.168.1.2

r1(config)#

*Mar 1 00:05:43.055: %LINEPROTO-5-UPDOWN: Line protocol . Interface Serial0/0,

changed state to down

r1(config)#ip route 192.168.3.0 255.255.255.0 192.168.1.2

R2

Router>en

Router#conf t

Enter configuration commands, .e per line. End with CNTL/Z.

Router(config)#host r2

r2(config)#enable password cisco

r2(config)#line vty 0 4

r2(config-line)#pass cisco

r2(config-line)#login

r2(config-line)#exit

r2(config)#int s0/0

r2(config-if)#ip addr 192.168.1.2 255.255.255.0

r2(config-if)#no shut

r2(config-if)#

*Mar 1 00:05:21.035: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up

*Mar 1 00:05:22.035: %LINEPROTO-5-UPDOWN: Line protocol . Interface Serial0/0,

changed state to upexit

r2(config)#int s0/1

r2(config-if)#ip addr 192.168.2.1 255.255.255.0

r2(config-if)#clock rate 64000

r2(config-if)#no shut

r2(config-if)#exit

r2(config)#

*Mar 1 00:25:35.283: %LINEPROTO-5-UPDOWN: Line protocol . Interface Serial0/1,

changed state to down%LINEPROTO-5-UPDOWN: Line protocol . Interface Serial0/1,

*Mar 1 00:25:45.267: %LINEPROTO-5-UPDOWN: Line protocol . Interface Serial0/1,

changed state to up: %LINEPROTO-5-UPDOWN: Line protocol . Interface Serial0/1,

changed state to down

r2(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2

R3

Router>en

Router#conf t

Enter configuration commands, .e per line. End with CNTL/Z.

Router(config)#host r3

r3(config)#enable password cisco

r3(config)#line vty 0 4

r3(config-line)#password cisco

r3(config-line)#login

r3(config-line)#exit

r3(config)#int s0/1

r3(config-if)#ip addr 192.168.2.2 255.255.255.0

r3(config-if)#no shut

r3(config-if)#exit

r3(config)#

*Mar 1 00:03:39.899: %LINK-3-UPDOWN: Interface Serial0/1, changed state to upi

*Mar 1 00:03:40.903: %LINEPROTO-5-UPDOWN: Line protocol . Interface Serial0/1,

changed state to u

r3(config)#int s0/2

r3(config-if)#ip addr 192.168.3.1 255.255.255.0

r3(config-if)#clock rate 64000

r3(config-if)#no shut

r3(config-if)#

*Mar 1 00:04:24.839: %LINK-3-UPDOWN: Interface Serial0/2, changed state to up

*Mar 1 00:04:25.839: %LINEPROTO-5-UPDOWN: Line protocol . Interface Serial0/2,

changed state to up

*Mar 1 00:04:53.839: %LINEPROTO-5-UPDOWN: Line protocol . Interface Serial0/2,

changed state to down

r3(config-if)#exit

r3(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1

.

R4

Router>en

Router#conf t

Enter configuration commands, .e per line. End with CNTL/Z.

Router(config)#host r4

r4(config)#enable pass cisco

r4(config)#line vty 0 4

r4(config-line)#pass cisco

r4(config-line)#login

r4(config-line)#exit

r4(config)#int s0/2

r4(config-if)#ip addr 192.168.3.2 255.255.255.0

r4(config-if)#no shut

r4(config-if)#

*Mar 1 00:03:04.871: %LINK-3-UPDOWN: Interface Serial0/2, changed state to up

*Mar 1 00:03:05.871: %LINEPROTO-5-UPDOWN: Line protocol . Interface Serial0/2,

changed state to up

r4(config-if)#exit

r4(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1

r4(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.1

下面是在R1上分別ping R2 R3 R4 的結果,

r1>ping 192.168.1.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 52/298/540 ms

r1>ping 192.168.2.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 140/218/376 ms

r1>ping 192.168.2.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 304/447/644 ms

r1>ping 192.168.3.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 140/460/804 ms

r1>ping 192.168.3.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.3.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 664/739/936 ms

哈哈 全網全通了!試驗宣告成功!!!!!

附:靜態路由的刪除:

(config)#no ip route 目標網段 目標網段的網絡掩碼 直連鄰居的接口IP地址

本文出自 “范琳琳學習筆記” 博客,請務必保留此出處http://fanlinlin.blog.51cto.com/535085/132177

本文出自 51CTO.COM技術博客

轉載于:https://blog.51cto.com/llier/133980

總結

以上是生活随笔為你收集整理的CCNA 配置试验之一 静态路由的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。