博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

小宝--读书笔记

精修内功!
  zieckey.cublog.cn

关于作者
思路决定出路,态度决定高度!
|| << >> ||
我的分类


实验3 IP路由研究――默认路由

 

作者:zieckey(zieckey@yahoo.com.cn)

All Rights Reserved

 

1.   实验目的

1)        掌握默认路由在组网中的应用

2)        掌握ip default-network命令的用法

3)        比较ip default-network命令和ip route 0.0.0.0 0.0.0.0命令设置路由的实现方法和实现特点

2.   实验原理

可被路由的协议(Routed Protocol)由路由协议(Routing Protocol)传输,前者亦称为网络协议。这些网络协议执行在源与目的设备的用户应用间通信所需的各种功能,不同的协议中这些功能可能差异很大。网络协议发生在OSI参考模型的上四层:传输层、会话层、表示层和应用层。

术语routed protocol(可被路由的协议)和routing protocol(路由协议)经常被混淆。routed protocol在网络中被路由,例如IPDECnetAppleTalkNovell NetWareOSIBanyan VINESXerox Network System(XNS)。而路由协议是实现路由算法的协议,简单地说,它给网络协议做导向。路由协议如:IGRPEIGRPOSPFEGPBGPIS-ISRIP等。

3.   实验过程

3.1. 配置路由器各个接口IP地址

London(config)#interface s0/0/1

London(config-if)#ip address 172.16.1.1 255.255.255.0

London(config-if)#no shutdown

London(config-if)#exit

London(config)#interface loopback 0

London(config-if)#ip address 10.1.1.1 255.255.255.0

London(config-if)#no shutdown

London(config-if)#exit

 

London#show CDP neighbors

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge

                  S - Switch, H - Host, I - IGMP, r - Repeater

 

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID

denver           Ser 0/0/0          170        R S I      2811      Ser 0/0/1

sw5              Fas 0/1            169         S I       WS-C3560- Fas 0/3

Florence         Ser 0/0/1          156        R S I      2811      Ser 0/0/0

sw9              Fas 0/0            176         S I       WS-C2950T Fas 0/23

London#

 

测试是否连通

London#ping 192.168.1.1

 

3.2. 配置RIP v1

London(config)#router rip

London(config-router)#network 10.0.0.0

 

Florence (config)#router rip

Florence (config-router)#network 10.0.0.0

Florence (config-router)#network 172.16.0.0

3.3. 配置FlorenceDenvor路由

Florence(config-router)# ip route 0.0.0.0 0.0.0.0 172.16.3.1

Denvor(config-router)# ip route 10.1.1.0 0.0.0.0 172.16.3.2

Denvor (config-router)# ip route 10.3.3.0 0.0.0.0 172.16.3.2

3.4. Londonping 192.168.1.1

London#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)

 

这里ping不通是很正常的,因为,在London上没有到192.168.1.1的路由,

London#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 le

       ia - IS-IS inter area, * - candidate default, U - per-user stati

       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is not set

 

     172.16.0.0/24 is subnetted, 1 subnets

C       172.16.1.0 is directly connected, Serial0/0/1

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.1.0 is directly connected, Loopback0

C    192.168.100.0/24 is directly connected, FastEthernet0/1

3.5. 配置一条默认路由

London#ip default-network 172.16.0.0

3.6. 再次在Londonping 192.168.1.1

London#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 = 28/28/28 ms

配置默认路由后网络就通了,这就说明在路由表中有默认路由时,没有在路由表中的IP地址的数据包就通过默认路由发送。

London#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 10.3.3.2 to network 172.16.0.0

 

R*   172.16.0.0/16 [120/1] via 10.3.3.2, 00:00:01, Serial0/0/1

     10.0.0.0/24 is subnetted, 2 subnets

C       10.3.3.0 is directly connected, Serial0/0/1

C       10.1.1.0 is directly connected, Loopback0

C    192.168.100.0/24 is directly connected, FastEthernet0/1

 

4.   实验分析与总结

通过这次实验让我们更深刻的了解了路由表中默认路由的用法和好处。同时我们又多接触了一些Cisco IOS命令。

下面对默认路由的原理和用法总结一下:

       R1---1.0---R2---2.0---R3

假如这是一个拓扑,那么在R1上起默认路由数据将从R1S0口转发出去到达R2,因为R2的路由表上有一条2.0网段的路由所以数据就可以发到R3上,然后在R3上起默认路由数据将从R3S0口转发出去到达R2,因为R2的路由表上有一条1.0网段的路由所以数据就可以发到R1上,这样整个网络就可以连通了

---1.1.1.1---R1---1.0---R2---2.0---R3---2.2.2.2---

如果在R1R3的两端加上环回接口,那么因为R2没有到达两个环回的路由所以数据无法到达环回的网段上,这时只要在R2上起两条静态路由到环回上在R2上就有到达两个环回的路由,依照前面的原理就知道这时整个网段都是连通的。

 

发表于: 2006-12-31,修改于: 2006-12-31 11:46,已浏览918次,有评论0条 推荐 投诉


网友评论
 发表评论