教你配置简单的静态路由

 我来答
没文化的大脑袋CU
2022-07-21 · TA获得超过2724个赞
知道小有建树答主
回答量:556
采纳率:100%
帮助的人:82万
展开全部

  为了更有说服力和便于理解我用CPT(Cisco Packet Tracer)演示了一下。

  拓扑图如下图所示:

  分别有四个网段,10.0.0.0/8、112.237.228.0/24、192.168.10.0/24、211.86.104.0/24。

  静态路由设置如下:

  ip route 192.168.10.0 255.255.255.0 112.237.228.1 ip route 211.86.104.0 255.255.255.0 112.237.228.1 ip route 10.0.0.0 255.0.0.0 112.237.228.244 ip route 211.86.104.0 255.255.255.0 192.168.10.1 ip route 112.237.228.0 255.255.255.0 192.168.10.2 ip route 10.0.0.0 255.0.0.0 192.168.10.2

  配置如下:

  1.PC0的IP配置:

  Packet Tracer PC Command Line 1.0

  PC>ipconfig

  IP Address......................: 10.0.0.3

  Subnet Mask.....................: 255.0.0.0

  Default Gateway.................: 10.0.0.1

  PC>

  2.PC1的IP配置:

  Packet Tracer PC Command Line 1.0

  PC>ipconfig

  IP Address......................: 211.86.104.52

  Subnet Mask.....................: 255.255.255.0

  Default Gateway.................: 211.86.104.254

  PC>

  3.R1的配置:

  Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R1 R1(config)#interface FastEthernet0/1 R1(config-if)#ip address 10.0.0.1 255.0.0.0 R1(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up R1(config-if)#end R1# %SYS-5-CONFIG_I: Configured from console by console R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int f0/0 R1(config-if)#ip addr 112.237.228.244 255.255.255.0 R1(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up R1(config-if)#end R1# %SYS-5-CONFIG_I: Configured from console by console R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ip route 192.168.10.0 255.255.255.0 112.237.228.1 R1(config)#ip route 211.86.104.0 255.255.255.0 112.237.228.1 R1(config)#end R1# %SYS-5-CONFIG_I: Configured from console by console R1#

  4.R2的配置:

  Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R2 R2(config)# R2(config)#interface FastEthernet0/1 R2(config-if)#ip address 112.237.228.1 255.255.255.0 R2(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up R2(config-if)# R2(config-if)#exit R2(config)#interface FastEthernet0/0 R2(config-if)#ip address 192.168.10.2 255.255.255.0 R2(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up R2(config-if)#end R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#ip route 10.0.0.0 255.0.0.0 112.237.228.244 R2(config)#ip route 211.86.104.0 255.255.255.0 192.168.10.1 R2(config)#end R2# %SYS-5-CONFIG_I: Configured from console by console R2#

  5.R3的配置:

  Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R3 R3(config)# R3(config)#interface FastEthernet0/1 R3(config-if)#ip address 192.168.10.1 255.255.255.0 R3(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up R3(config-if)# R3(config-if)#exit R3(config)#interface FastEthernet0/0 R3(config-if)#ip address 211.86.104.254 255.255.255.0 R3(config-if)#no shutdown R3(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up R3>enable R3#conf t Enter configuration commands, one per line. End with CNTL/Z. R3(config)#ip route 112.237.228.0 255.255.255.0 192.168.10.2 R3(config)#ip route 10.0.0.0 255.0.0.0 192.168.10.2 R3(config)#end R3# %SYS-5-CONFIG_I: Configured from console by console R3#

  6.使用tracert进行测试:

  测试从PC0能否路由到PC1。

  结果表明测试成功。

  测试从PC1能否路由到PC0。

  结果表明测试成功。

已赞过 已踩过<
你对这个回答的评价是?
评论 收起
宏电
2024-09-30 广告
简单说区别主要在于功能上智能网关功能更丰富,支持的协议更多,数据量处理也相对大,路由器主要还是数据透传为主,智能工业网关可以进行数据采集处理分析,为了管理不同网段的IP,例如在交换机上做VLAN的时候,就需要在默认的VLAN接口之下做一个I... 点击进入详情页
本回答由宏电提供
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式