Static routing and default routing configuration

Well established as follows topology shown below:

 

 Three experiments addressing two routers and the PC as shown below:

 

 The LIUHUI1, LIUHUI2, LIUHUI3 of IP set:

 

 

 

 Detecting respective direct links of communication with the ping command:

 

 

 

 

 

 On PC1 pingPC2, ping nowhere found:

 

 
      Receiving from the first prosthesis machine Wang PC-1 and PC-2 B n can be suspended if the communication between, the host A transmits the data to the gateway device which R1; R1 will receive according to the destination address of the packet to see in its routing table , find the corresponding host route entry to the destination network, and forwarded to the next router R2 in accordance with the next hop and the egress of the information of the data entry; R2 take similar steps forward data to R3; R3 may also be taken and finally the same procedure will be forwarded to their data directly connected to the host PC-2; PC-2 in hosts after receiving the data, and process data transmitted to the host PC-1 PC-2 - the same, and then sends a corresponding response message to the PC-1
      in the case of the basic configuration to ensure no errors, first check whether the normal communication between the host PC-1 gateway R1 thereto. The following figure shows the problem is not, then check the routing table:

 

 

 

 

 

 

 

 Can be found, no information about the host PC2, not on R1 R2 in respect of PC1, PC2, information, no information about the host PC1 in R3, if one thousand now spans between the host PC1 and PC2 a different network segment, to enable communication therebetween, through simple basic configuration of the IP address can not be achieved, must be added the appropriate routing information in routers 3, may be realized by a static route configuration.
There are two ways to configure a static route, - - kind of take specified in the configuration - - hop IP address of the way, and the other - - kind of a way is specified interface.
Configuring the destination network segment on the host PC-2 R1 is a static route segment, namely the destination IP address is 192.168.20.0, the mask is 255.255.255.0. For R1, the data to be transmitted to the host PC-2, must first be sent to R2, R2 is the next so that the R1 - IP Address of the interface on the physical direct link hop router, i.e., where R1 and R2 for the next hop IP address, that is 10.0.12.2. Similarly R2 and R3:

 

 然后发现还是无法联通,因为只有发送的消息,没有返回的消息:

 

 
      此时主机PC-1仅发送了ICMP请求消息,并没有收到任何回应消息。原因在于现在仅仅实现了PC-1能够通过路由将数据正常转发给PC-2, 而PC-2仍然无法发送数据给PC-1,所以同样需要在R2和R3的路由表上添加PC-1所在网段的路由信息。
      在R3上配置目的网段为PC-1所在网段的静态路由,即目的IP地址为192.168.10.0,目的地址的掩码除了可以采用点分十进制的格式表示外,还可以直接使用掩码长度,即24来表示。对于R3而言,要发送数据到PC-1, 则必须先发送给R2, 所以R3与R2所在直连链路上的物理接口S 0/0/1即为数据转发接口,也称为出接口,在配置中指定该接口即可。

 

 R2同理:

 

 查看R1,R2,R3的路由表,可知每台路由器上都有PC1与PC2的路由信息:

 

 

 

 

 

 现在再在PC1上pingPC2,发现现在可以ping通:

 

通过适当减少设备上的配置工作量,能够帮助网络管理员在进行故障排除时更轻松地定位故障,且相对较少的配置量也能减少在配置时出错的可能,另一方面,也能够相.对减少对设备本身硬件的负担。
默认路由是一种特殊的静 态路由,使用默认路由可以简化路由器上的配置。
此时R1上存在两条先前经过手动配置的静态路由条目,且它们的下一-跳和出接口都一致。
现在在R1上配置一条默认路由, 即目的网段和掩码为全0,表示任何网络,下一跳为10.0.12.2,并删除先前配置的两条静态路由。

 

 现在再在PC1上pingPC2,发现现在不仅可以ping通,而且配置量也很少:

Guess you like

Origin www.cnblogs.com/FHBBS/p/12000159.html