1.拓扑图

sshot-1.png

2.PC机配置IP地址(当前网络第二小地址,网关为当前路由器接口地址)

例如:PC0
sshot-2.png

3.配置路由器接口地址(使用当前网络最小地址即可)

Router0:

Router(config)#int f0/0
Router(config-if)#ip add 192.168.10.1 255.255.255.0
Router(config-if)#no shutdown 

Router(config)#int f0/1
Router(config-if)#ip add 192.168.20.1 255.255.255.0
Router(config-if)#no shu

Router(config)#int s0/1/0
Router(config-if)#ip add 192.168.50.1 255.255.255.0
Router(config-if)#no shu

Router1:

Router(config)#int f0/0
Router(config-if)#ip add 192.168.30.1 255.255.255.0
Router(config-if)#no shu

Router(config)#int f0/1
Router(config-if)#ip add 192.168.40.1 255.255.255.0
Router(config-if)#no shut

Router(config)#int s0/1/0
Router(config-if)#ip add 192.168.50.2 255.255.255.0
Router(config-if)#no shut

4.配置静态路由

配置命令:
ip route 目的网络地址 目的地址子网掩码 下一跳
有两种配置方法
例如:
ip route 192.168.30.0 255.255.255.0 192.168.50.2
ip route 192.168.30.0 255.255.255.0 s0/1/0

Router0:

ip route 192.168.30.0 255.255.255.0 192.168.50.2
ip route 192.168.40.0 255.255.255.0 192.168.50.2

Router1:

ip route 192.168.10.0 255.255.255.0 192.168.50.1
ip route 192.168.20.0 255.255.255.0 192.168.50.1

5.查看路由表

show ip route
Router0:
sshot-3.png
Router1:
sshot-4.png

6.测试连通性

sshot-5.png