出入口静态路由

编程知识 更新时间:2023-05-03 00:08:19

完成拓扑结构

Router(config)#int g0/1
Router(config-if)#ip add 10.1.1.1 255.255.255.0
Router(config-if)#no shutdown。

配置g口路由器ip,使主机可以连通路由器

Router(config)#int s0/2/0
Router(config-if)#ip add 172.1.1.2 255.255.255.0
Router(config-if)#clock rate 2000000
Router(config-if)#no shutdown

配置R1 s0/2/0串口ip,设置时钟率

Router(config)#int s0/2/0
Router(config-if)#ip add 172.1.1.1 255.255.255.0
Router(config-if)#no shutdown

配置R0 s0/2/0,路由器串口两边都要配置

Router(config)#int s0/2/1
Router(config-if)#ip add 172.1.2.1 255.255.255.0
Router(config-if)#clock rate 2000000
Router(config-if)#no shutdown

配置中转路由R0的另一个串口

时钟配置要向水一样顺时针

相同方法配置R2

配置静态路由

同一个路由下默认有直连路由,其下三个网络可以相互连通

不知道下一条的地址,可以用出入口来配置静态路由

比如左边的网络想要访问到172.1.2.1 已知出口是s0/2/0,可以这样写
Router(config)#ip route 172.1.2.0 255.255.255.0 s0/2/0


配置R1

Router(config)#ip route 172.1.2.0 255.255.255.0 s0/2/0
%Default route without gateway, if not a point-to-point interface, may impact performance
Router(config)#ip route 192.168.1.0 255.255.255.0 s0/2/0
%Default route without gateway, if not a point-to-point interface, may impact performance
Router(config)#ip route 192.168.2.0 255.255.255.0 s0/2/0
%Default route without gateway, if not a point-to-point interface, may impact performance

配置R2

Router(config)#ip route 172.1.1.0 255.255.255.0 s0/2/1
%Default route without gateway, if not a point-to-point interface, may impact performance
Router(config)#ip route 10.1.1.0 255.255.255.0 s0/2/1
%Default route without gateway, if not a point-to-point interface, may impact performance
Router(config)#ip route 10.1.2.0 255.255.255.0 s0/2/1
%Default route without gateway, if not a point-to-point interface, may impact performance

配置R0 注意左边网络的出口是s0/2/0,右边网络的出口是s0/2/1

Router(config)#ip route 10.1.1.0 255.255.255.0 s0/2/0
%Default route without gateway, if not a point-to-point interface, may impact performance
Router(config)#ip route 10.1.2.0 255.255.255.0 s0/2/0
%Default route without gateway, if not a point-to-point interface, may impact performance
Router(config)#ip route 192.168.1.0 255.255.255.0 s0/2/1
%Default route without gateway, if not a point-to-point interface, may impact performance
Router(config)#ip route 192.168.2.0 255.255.255.0 s0/2/1
%Default route without gateway, if not a point-to-point interface, may impact performance

设置成功!

附加

下一跳 命令和出入口差不多 只在最后有所区别

ip route 172.1.1.0 255.255.255.0 出入口
ip route 172.1.1.0 255.255.255.0 下一跳ip地址

更多推荐

出入口静态路由

本文发布于:2023-04-29 13:47:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/5830f97e42566a2e9f6cf44e323a6d9b.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:出入口   路由   静态

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 110983文章数
  • 28327阅读数
  • 0评论数