快盘下载:好资源、好软件、快快下载吧!

快盘排行|快盘最新

当前位置:首页软件教程电脑软件教程 → 实验1静态路由实验

实验1静态路由实验

时间:2022-09-30 08:00:16人气:作者:快盘下载我要评论

静态路由实验配置

首先绘制出本次实验需要的网路拓扑

实验1静态路由实验

测试主机之间是否能相互通信

C:>ping 192.168.3.101

Pinging 192.168.3.101 with 32 bytes of data:

Reply from 192.168.1.1: Destination host unreachable.
Reply from 192.168.1.1: Destination host unreachable.
Reply from 192.168.1.1: Destination host unreachable.
Reply from 192.168.1.1: Destination host unreachable.

Ping statistics for 192.168.3.101:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

显示目的网络不可达

查看当前Router0路由表
Router#show 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
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, 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

C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1

查看当前Router1路由表
Router#show 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
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, 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

C    192.168.2.0/24 is directly connected, FastEthernet0/0
C    192.168.3.0/24 is directly connected, FastEthernet0/1

其中;显示的C为Connected;意思是该路由器的直连网络地址

显示S为Static;意思是该路由器的静态网络地址

网络拓扑简化图如下

192.168.1.0 192.168.2.0 192.168.3.0 192.168.1.101 Router0 Fa0/0 (192.168.1.1) Router0 Fa0/1 (192.168.2.1) Router1 Fa0/1 (192.168.2.2) Router1 Fa0/0 (192.168.3.1) 192.168.3.101

1. 确定目的网络和下一跳地址

目的网络;路由器不能到达的网络地址就是目的网络

步骤;

观察网络拓扑;以其中一个路由器Router0开始分析

确定Router0所有不能到达的网络地址

观察可得无法直连的网络地址有;192.168.3.0

确定Router1所有不能到达的网络地址

观察可得无法直连的网络地址有;192.168.1.0

开始分析下一跳地址;以Router0为例

例;要发送报文到 目的网络 192.168.1.0;故下一跳为主机Fa端口的网络地址 192.168.1.101

目的网络地址下一跳地址192.168.1.0192.168.1.101192.168.2.0192.168.2.2192.168.3.0192.168.2.2

不难理解;你的下一跳地址就是报文从当前路由器发出之后到达的第一个其他主机/路由器的端口的IP地址

开始分析下一跳地址;以Router1为例

例;要发送报文到 目的网络 192.168.1.0 需要先经过Router0 端口Fa0/1 192.168.2.1

故下一跳为Router0端口Fa0/1的网络地址

目的网络地址下一跳地址192.168.1.0192.168.2.1192.168.2.0192.168.2.1192.168.3.0192.168.3.101

2. 配置静态路由表

前面我们分析了两个路由器的目的网络和下一跳地址;现在我们需要开始配置静态路由表

直连网络在上面已经有所体现;配置静态路由表的时候不需要配置直连网络

只需要配置路由器无法到达的网络地址即可

Router0的配置前的路由表
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1

Router1的配置前的路由表
C    192.168.2.0/24 is directly connected, FastEthernet0/0
C    192.168.3.0/24 is directly connected, FastEthernet0/1

配置静态路由表的命令

添加一个静态路由表Router(config)# ip route [目的网络] [子网掩码] [下一跳网络地址]
删除一个静态路由表Router(config)# no ip route [目的网络] [子网掩码] [下一跳网络地址]

添加路由表;Router0路由器命令行配置如下

Router>en
Router#conf
Router#configure te
Router#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2

同理;Router1路由器也配置

Router>en
Router#conf
Router#configure ter
Router#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1

查看路由表;

Router0配置后的路由表
Router#show ip route
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
S    192.168.3.0/24 [1/0] via 192.168.2.2

Router1配置后的路由表
Router#show ip route
S    192.168.1.0/24 [1/0] via 192.168.2.1
C    192.168.2.0/24 is directly connected, FastEthernet0/0
C    192.168.3.0/24 is directly connected, FastEthernet0/1

测试主机之间是否能够相互通信

左边的主机ping右边的主机;测试成功
C:>ping 192.168.3.101

Pinging 192.168.3.101 with 32 bytes of data:

Reply from 192.168.3.101: bytes=32 time<1ms TTL=126
Reply from 192.168.3.101: bytes=32 time=1ms TTL=126
Reply from 192.168.3.101: bytes=32 time=1ms TTL=126
Reply from 192.168.3.101: bytes=32 time<1ms TTL=126

Ping statistics for 192.168.3.101:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms
    
右边的主机ping左边的主机;测试成功
C:>ping 192.168.1.101

Pinging 192.168.1.101 with 32 bytes of data:

Reply from 192.168.1.101: bytes=32 time<1ms TTL=126
Reply from 192.168.1.101: bytes=32 time<1ms TTL=126
Reply from 192.168.1.101: bytes=32 time<1ms TTL=126
Reply from 192.168.1.101: bytes=32 time<1ms TTL=126

Ping statistics for 192.168.1.101:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

测试完毕;静态路由配置成功

网友评论

快盘下载暂未开通留言功能。

关于我们| 广告联络| 联系我们| 网站帮助| 免责声明| 软件发布

Copyright 2019-2029 【快快下载吧】 版权所有 快快下载吧 | 豫ICP备10006759号公安备案:41010502004165

声明: 快快下载吧上的所有软件和资料来源于互联网,仅供学习和研究使用,请测试后自行销毁,如有侵犯你版权的,请来信指出,本站将立即改正。