完成拓扑结构
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地址