静态路由选择方法有哪几种?
设置计算机A的IP为192。168。1。2子网掩码为255。255。255。0网关为192。169。1。1
设置计算机B的IP为192。168。2。2子网掩码为255。255。255。0网关为192。 169。2。1
给路由A的fastEthernet 0/0端口配置IP为192。168。1。1子网掩码为255。255。255。0,由于路由默认的端口是关闭的,所以在给路由端口配置好IP以后,要注意用no shutdown(不关闭)命令把端口开启!如下是配置路由A端口fastEthernet 0/0的所有命令:
Continuewith configuration dialog? [yes...全部
设置计算机A的IP为192。168。1。2子网掩码为255。255。255。0网关为192。169。1。1
设置计算机B的IP为192。168。2。2子网掩码为255。255。255。0网关为192。
169。2。1
给路由A的fastEthernet 0/0端口配置IP为192。168。1。1子网掩码为255。255。255。0,由于路由默认的端口是关闭的,所以在给路由端口配置好IP以后,要注意用no shutdown(不关闭)命令把端口开启!如下是配置路由A端口fastEthernet 0/0的所有命令:
Continuewith configuration dialog? [yes/no]: no
Router#configure terminal(进入全局配置模式)
Router(config)#interfacefastEthernet 0/0(进入端口模式,进入端口0/0了)
Router(config-if)#noshutdown(开启端口)
给路由A的fastEthernet 1/0端口配置IP为192。
168。3。1子网掩码为255。255。255。0,如下是配置路由A端口fastEthernet1/0的所有命令
Router(config-if)#exit(从0/0端口退回到全局配置模式)
Router(config)#interfacefastEthernet 1/0(进入1/0端口)
Router(config-if)#ipaddress 192。
168。3。1 255。255。255。0(给端口1/0配置好了IP跟子网掩码)
Router(config-if)#noshutdown(开启端口)
%LINK-5-CHANGED:Interface FastEthernet1/0, changed state to up
Router(config-if)#exit(从1/0端口退回到全局配置模式)
给路由B的fastEthernet 1/0端口配置IP为192。
168。3。2子网掩码为255。255。255。0,如下是配置路由B端口fastEthernet1/0的所有命令
Continuewith configuration dialog? [yes/no]: no
Router>enable(进入特权模式)
Router#configure terminal(进入全局配置模式)
Enterconfiguration commands, one per line。
End with CNTL/Z。
Router(config)#interfacefastEthernet 0/0(进入端口模式,进入端口0/0了)
Router(config-if)#ipaddress 192。
168。3。2 255。255。255。0(给端口0/0配置好了IP,子网掩码)
Router(config-if)#noshutdown(开启端口)
给路由B的fastEthernet 0/0端口配置IP为192。
168。2。1子网掩码为255。255。255。0,如下是配置路由A端口fastEthernet1/0的所有命令
Router(config-if)#exit(从0/0端口退回到全局配置模式)
Router(config)#interface fastEthernet 1/0(进入1/0端口)
Router(config-if)#ip address 192。
168。2。1 255。255。255。0(给端口1/0配置好了IP跟子网掩码)
Router(config-if)#no shutdown(开启端口)
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up
Router(config-if)#exit(从1/0端口退回到全局配置模式)
给路由B设置静态跳转,若遇到访问计算机A(也就是192。
168。1。0)这个网段的数据包,给他规定了往路由A的1/0端口(也就是192。168。3。1)跳转,再在跳转后到达的路由查询路由表,查询计算机A(也就是192。168。1。0)的这个网段再转发数据包!具体命令如下:
Router(config)#iproute 192。
168。1。0 255。255。255。0 192。168。3。1(在全局配置模式下)
在路由A也设置一个跳转,要不数据发送出去了,找不到回来就路,那么就没返回信息了!具体命令如下:
Router(config)#iproute 192。
168。2。0 255。255。255。0 192。168。3。
2(在全局配置模式下)
用ping命令测试全网是否连通了
配置静态路由,一定要两个路由都有配置到跳转,要不的话,只配置了一个路由,那么造成的情况就是数据包无法发送出来或数据包发送出去了,找不到返回的地址!切记
希望能帮到你,麻烦给“好评”。收起