静态路由的应用场合

• 一个小型到中型的网络,而且没有或只有较小的扩充计划时。

• 静态路由要手工输入,手工管理;管理开销对于动态路由来说是一个大大的负担。

静态路由优缺点

优点:

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 配置试验之一 静态路由相关推荐

  1. CCNA配置试验之六 标准ACL和扩展ACL的配置

    访问控制列表分为标准访问控制列表和扩展访问控制列表:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office: ...

  2. 华为交换机模拟器_从零开始学习华为路由交换 | 配置缺省静态路由

    实验前准备 1.电脑上安装华为ENSP模拟器 2.添加三台路由器 命令介绍 AR1配置 1.配置接口IP 2.配置缺省静态路由: [R1]ip route-static 0.0.0.0 0 g0/0/ ...

  3. 实战 | F1060路由模式典型组网配置案例(静态路由)

    实战 | F1060路由模式典型组网配置案例(静态路由) : https://mp.weixin.qq.com/s/p1CFg0mUWDSZgqu7ErXa4g 组网说明: 本案例采用H3C HCL模 ...

  4. 路由配置与管理——静态路由配置与管理

    静态路由是一种最简单的路由,需手工配置,用一条指令指定静态路由的目的IP地址.子网掩码.下一跳IP地址,或者出接口.优先级等主要参数值就可以了.还可根据实际需要配置静态路由与BFD或者NQA的联动. ...

  5. 14、配置路由器的静态路由

    1.相关知识 什么是路由器 路由器(Router)是连接两个或多个网络的硬件设备,在网络间起网关的作用,是读取每一个数据包中的地址然后决定如何传送的专用智能性的网络设备.它能够理解不同的协议,例如某个 ...

  6. Linux配置双网卡--静态路由

    Linux配置双网卡--静态路由 1.服务器双网卡配置要点 1.服务器双网卡配置要点 举例说明:网卡eth0,网卡eth1加静态路由 实现双网卡配置 .需求:10.179.50.1需要访问此服务器①. ...

  7. 计算机网络 实验六 静态路由配置,实验六-静态路由配置.doc

    实验六-静态路由配置 实验报告书 课程名称 计算机网络技术与应用 实验题目 实验六:静态路由配置 专业班级 2010级信息管理与信息系统2班 学 号 37号 姓 名 肖丹妮 指导教师 赵圆圆老师 计算 ...

  8. GRE隧道配置实验(静态路由)

    实验目的: 配置GRE隧道,并在隧道上运行静态路由实现互通 组网需求: 如图,R1.R2.R3属于VPN骨干网,它们之间运行OSPF.R2和R3之间使用三层隧道协议GRE,实现PC1和PC2互联.PC ...

  9. 华为运营商级路由器配置示例 | IPv4静态路由

    组网需求 路由器各接口及主机的IP地址和掩码如图1所示.要求采用静态路由,使图中任意两台主机之间都能互通. 图1 配置IPv4静态路由组网图 配置思路 首先配置各路由器各接口的IPv4地址,使网络互通 ...

最新文章

  1. 通过gdb core dump方法查看程序异常时的堆栈信息
  2. 初识C语言---(4)
  3. python 字符串可以直接连接吗_如何连接字符串。。。在?(Python)
  4. SQL Server基础
  5. idea中不小心把文件夹删了
  6. SAP从视图获得数据
  7. 【MyBatis】第一章 快速入门
  8. log4c移植到android,使用Android Studio调用C++ 代码-log4cplus
  9. java提高数据库访问效率代码优化
  10. 【缺陷检测】基于matlab区域生长算法对焊接孔隙缺陷检测【含Matlab源码 829期】
  11. net framework 4.0安装未成功,原因是?
  12. CMMI5级认证含金量高吗?
  13. 21天学通python-21天学通Python(第2版)_PDF电子书
  14. 流利阅读12.18 Coffee or tea? The answer might be in your genes
  15. javaweb+移动端 富文本
  16. ES 中时间日期类型 “yyyy-MM-dd HHmmss” 的完全避坑指南
  17. 工具分享--IDM下载工具利器,让下载速度提升一百倍
  18. android x5 webview报错,appium 混合 APP,x5 内核,webview 切换报错
  19. CSU2020:Artwork(并查集)
  20. 常见Shell编程脚本

热门文章

  1. 【杂谈】从失业到重要项目负责人,2020年里我如何在有三AI上岸
  2. 为什么有三AI从来不追热点,信息越多学的越慢
  3. 全球及中国抗水解剂市场需求容量与投资可行性研究报告2022年
  4. 中国工程机械制造行业运营状况及发展方向预测报告2021-2027年
  5. python获取系统硬件信息
  6. GDI中的坐标映射问题
  7. 自己实现spring核心功能 一
  8. 4 VMware安装
  9. (2) LVS负载均衡:VS_TUN和VS_DR的arp问题
  10. linux 遇到的问题