注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 [业内传闻]今天,7月25日..
 帮助

静态路由配置(Static Routing)


2007-06-06 13:10:23
 标签:静态路由   [推送到技术圈]

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://loveme23.blog.51cto.com/7891/29135
实验来源:工大瑞普Cisco网络技术论坛

1.按照试验拓扑,配置好路由器的各个接口IP;
2.使用ping命令验证路由器之间的连同性,以r1为例:
r1#ping 10.3.3.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.3.3.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/67/116 ms
略......
再用r1 ping r2的loopback和r3的ip:
r1#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
略......
r1无法ping通r2的loopback地址和r3的ip地址,需要添加静态路由。
3.下面在3台路由器上使用命令ip route添加相应的静态路由:
r1(config)#ip route 192.168.1.0 255.255.255.0 10.3.3.2         //设置静态路由到192.168.1.0/24,                                                                                                   下一跳地址为10.3.3.2 r1(config)#ip route 172.16.3.0 255.255.255.0 10.3.3.2
r1(config)#ip route 172.16.1.0 255.255.255.0 10.3.3.2
r1(config)#ip route 172.16.2.0 255.255.255.224 10.3.3.2

r2(config)#ip route 10.1.1.0 255.255.255.0 10.3.3.1
r2(config)#ip route 10.2.2.0 255.255.255.224 10.3.3.1
r2(config)#ip route 172.16.1.0 255.255.255.0 172.16.3.1
r2(config)#ip route 172.16.2.0 255.255.255.224 172.16.3.1

r3(config)#ip route 192.168.1.0 255.255.255.0 172.16.3.2
r3(config)#ip route 10.3.3.0 255.255.255.0 172.16.3.2
r3(config)#ip route 10.1.1.0 255.255.255.0 172.16.3.2
r3(config)#ip route 10.2.2.0 255.255.255.224 172.16.3.2
然后再次验证:
r1#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/59/60 ms
其余略......
可以ping通。
查看一下r1的路由表:
r1#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

     172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
S       172.16.1.0/24 [1/0] via 10.3.3.2
S       172.16.2.0/27 [1/0] via 10.3.3.2
S       172.16.3.0/24 [1/0] via 10.3.3.2
     10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C       10.3.3.0/24 is directly connected, Serial1/1
C       10.2.2.0/27 is directly connected, Loopback1
C       10.1.1.0/24 is directly connected, Loopback0
S    192.168.1.0/24 [1/0] via 10.3.3.2
S代表静态路由。(其余路由器略......)
总结:其实如果路由器属于末梢节点的话,可以只用一条默认路由也可以实现上面的效果,例如r1:
r1(config)#ip route 0.0.0.0 0.0.0.0 10.3.3.2
这样也可以ping通其余的ip地址。
OK,试验完!

本文出自 “★Beckham~23” 博客,请务必保留此出处http://loveme23.blog.51cto.com/7891/29135



上一篇 GNS-3 On windows  下一篇 标准ACL(Standard ACL)



    文章评论
 
2007-06-06 20:47:42
真是太简单了.

2007-06-06 22:04:09
这个是我新想到的,把CCNA的有关配置全部发上来,CCNA的配置是有点简单,等做完CCNA后,我会继续把CCNP的实验发上来的,请继续关注。。。

2007-06-07 22:31:29
呵呵,其实静态路由有的时候也起很重要的作用,这个虽然相对简单,但是也比较重要.呵呵,以后有新东西多贴贴哦!

2007-06-07 23:02:53
呵呵
静态的 是有些简单.

2007-06-08 06:46:20
嗯,静态路由是比较简单,它只是针对小型网络的。

2007-06-08 19:44:47
原来这样的,我知道我的错误了,谢谢

2007-06-08 21:50:41
客气,大家共同学习,一起进步!

2008-03-16 00:31:26
只有末梢路由器才可使用缺省路由吗?

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: