Static routing and default route basic configuration

I. Purpose

 

 II. Experimental topology

 

 

III. Addressing experiment

IV. Experimental Procedure

Basic configurations

Configure interfaces and PC-IP

 

 

 

 

 

 

 

 

 

 Ping command to check each of the direct communication link

 

 Use direct ping PC2 PC1

 

 In the case of the basic configuration to ensure error-free, to see whether the normal communication between the host and its gateway R1 PC1

 

 Check the routing table on the gateway device R1

 

 You can not see any information about the network segment where the PC2, R2 R3 routing table view

 

 

 

Can be seen without any information about the PC-1 PC-2 is located on the network segment and the host R2, R3. No information about the PC 1-on network host is located, and to verify that the routers the routing table on the initial It includes only the routing information directly connected with the segment.

 2. The communication between PC1 and PC2

R1 is disposed in the object network static route segment where the host PC2, i.e., the destination IP address 192.168.20.0, mask of 255.255.255.0. For R1, the data to be transmitted to the PC2, must be sent to R2, so R2 is the next hop router R1, where R1 and R2 are directly connected IP address of the interface on the physical link is the next hop IP address, i.e., 10.0.12.2

 

 Configuration, display the routing table R1

 

 R1 can see the routing table routing segment where information PC2

Take the same way to configure the destination network segment in R2 static routing segment where PC2

 

 View the routing table, routing information has been found where the segment PC2

 

 At this point in ping PC2 PC1

 In this case we still found not ping data capture on E0 / 0/1 interfaces of PC1, as shown in FIG phenomenon can be seen

 At this point the host PC1 only send the ICMP request information, it has not received any response messages. The reason is that only achieve a normal route through PC1 send data to PC2, but still can not send data to PC2 PC1, PC1 so you need to add the same network segment where the routing information in the routing table on R2 R3.

  Arranged on the destination network segment where R3 is a static route segment PC1, i.e., destination IP address 192.168.10.0, in addition to the destination address mask in dotted decimal format may be employed outside the mask length may be used directly, i.e., 24 to represent. For R3, the data to be sent to PC1, need to be sent to R2, R2 and R3 where it is directly connected to the data link interface S 0/0/1 forwarding interface.

 

 

 

 配置完成后,查看R1  R2  R3 的路由表

 

 

 

 此时,每台路由器上都拥有了PC1  PC2所在网段的路由信息,再在PC1 上ping PC2

 

 可以连通,即现在已经实现PC1 与PC2之间的正常通信

3.实现全网全通来增强网络可靠性

假设此时网络出现故障,PC1侧的网管发现无法与PC2正常通信,于是先测试与网管R1的连通性

 

 发现与网管间通信正常,在测试与PC2的网关设备R3的连通性

 发现无法与R3正常通信,意味着网管无法通过PC1登录R3上进一步排除故障,由此可见,保证全网连通性可以增强整网的可靠性,提高网络可维护性以及健壮性。因此有必要在R1路由表中添加R2  R3间直连网断的路由信息,同样在R3的路由表中加入R1  R2 之间直连网断的路由信息,实现全网全通。

 

 

 配置完成,查看R1  R2  R3的路由表,注意新增的条目

 

 

 

 

 

 

 

此时再测试PC1与PC3间连通性

 

 

 

 

 

 4.使用默认路由实现简单的网络优化

查看R1的路由表

 

 

 

 在R1上配置一条默认路由,即目的网段和掩码为全0,表示任何网络,下一跳为10.0.12.2,并删除先前配置的两条静态路由

 

 

 

 再次测试PC1与PC2连通性

 

 

 

发现PC1   PC2之间通信正常,证明使用默认路由不但可以实现与静态路由同样的效果,还能减少配置量。在R3进行同样配置

 

 再次测试PC1与PC2之间连通性

 

 Tips:在配置过程中,顺序是先配置默认路由,在删除原有静态路由配置,这样可以避免网络出现通信中断,即要在配置过程中注意操作的规范性与合理性

 

 

一.实验目的

 

 二.实验拓扑图

 

 

三.实验编址

四.实验步骤

1.基本配置

配置各接口及PC机IP

 

 

 

 

 

 

 

 

 

 使用ping命令检测各直连链路的连通性

 

 使用PC1 直接ping  PC2

 

 在保证基本配置无错的情况下,查看主机PC1与其网关R1之间是否能正常通信

 

 查看网关设备R1上的路由表

 

 可以看到没有任何关于PC2所在网段的信息,查看R2   R3 的路由表

 

 

 

可以看到在R2上没有任何关于主机PC-1和PC-2所在网段的信息,R3.上没有任何关于主机PC-1所在网段的信息,验证了初始情况下各路由器的路由表上仅包括与自身直接相连的网段的路由信息。

 2.实现PC1与PC2之间的通信

在R1配置目的网段为主机PC2 所在网段的静态路由,即目的IP地址为192.168.20.0,掩码为255.255.255.0.对于R1而言,要发送数据到PC2,必须先发送给R2,所以R2为R1下一跳路由器,R2与R1所在直连链路上的物理接口的IP地址即为下一跳IP地址,即10.0.12.2

 

 配置完成,查看R1路由表

 

 可以看到R1的路由表中有PC2所在网段的路由信息

采取同样方式在R2配置目的网段为PC2所在网段的静态路由

 

 查看路由表,发现已经有PC2所在网段的路由信息

 

 此时 在PC1上ping  PC2

 发现仍然ping不通           此时我们在PC1的E0/0/1接口上进行数据抓包,可看到如图所示的现象

 此时主机PC1仅发送了ICMP请求信息,并未收到任何回应消息。原因是仅实现了PC1能通过路由将数据正常发送给PC2,而PC2仍然无法发送数据给PC1,所以同样需要在R2  R3 路由表上添加PC1所在网段路由信息。

  在R3上配置目的网段为PC1所在网段的静态路由,即目的IP地址为192.168.10.0,目的地址掩码除了可以采用点分十进制的格式表示之外,还可以直接使用掩码长度,即24来表示。对R3而言,要发送数据给PC1,需要先发送给R2,所以R3与R2所在直连链路接口S 0/0/1为数据转发接口。

 

 

 

 配置完成后,查看R1  R2  R3 的路由表

 

 

 

 此时,每台路由器上都拥有了PC1  PC2所在网段的路由信息,再在PC1 上ping PC2

 

 可以连通,即现在已经实现PC1 与PC2之间的正常通信

3.实现全网全通来增强网络可靠性

假设此时网络出现故障,PC1侧的网管发现无法与PC2正常通信,于是先测试与网管R1的连通性

 

 发现与网管间通信正常,在测试与PC2的网关设备R3的连通性

 发现无法与R3正常通信,意味着网管无法通过PC1登录R3上进一步排除故障,由此可见,保证全网连通性可以增强整网的可靠性,提高网络可维护性以及健壮性。因此有必要在R1路由表中添加R2  R3间直连网断的路由信息,同样在R3的路由表中加入R1  R2 之间直连网断的路由信息,实现全网全通。

 

 

 配置完成,查看R1  R2  R3的路由表,注意新增的条目

 

 

 

 

 

 

 

此时再测试PC1与PC3间连通性

 

 

 

 

 

 4.使用默认路由实现简单的网络优化

查看R1的路由表

 

 

 

 在R1上配置一条默认路由,即目的网段和掩码为全0,表示任何网络,下一跳为10.0.12.2,并删除先前配置的两条静态路由

 

 

 

 再次测试PC1与PC2连通性

 

 

 

发现PC1   PC2之间通信正常,证明使用默认路由不但可以实现与静态路由同样的效果,还能减少配置量。在R3进行同样配置

 

 再次测试PC1与PC2之间连通性

 

 Tips:在配置过程中,顺序是先配置默认路由,在删除原有静态路由配置,这样可以避免网络出现通信中断,即要在配置过程中注意操作的规范性与合理性

 

Guess you like

Origin www.cnblogs.com/wxzjdq/p/12030322.html