赞
踩
PCA:10.65.1.1 PCB:10.66.1.1 PCC:10.70.1.1 PCD:10.71.1.1
[RouterA]interface ethernet0
[RouterA-Ethernet0]ip addrress 10.65.1.2 255.255.0.0
[RouterA-Ethernet0]undo shutdown
[RouterA-Ethernet0]int e1
[RouterA-Ethernet1]ip addrress 10.66.1.2 255.255.0.0
[RouterA-Ethernet1]undo shutdown
[RouterA-Ethernet1]int s1
[RouterA-Serial1]ip addrress 10.68.1.2 255.255.0.0
[RouterA-Serial1]undo shutdown
[RouterA-Serial1]clock rate 64000
[RouterA-Serial1]quit
[RouterA]ip routing
[RouterA]dis curr
[RouterB]interface ethernet0
[RouterB-Ethernet0]ip addrress 10.70.1.2 255.255.0.0
[RouterB-Ethernet0]undo shutdown
[RouterB-Ethernet0]int e1
[RouterB-Ethernet1]ip addrress 10.71.1.2 255.255.0.0
[RouterB-Ethernet1]undo shutdown
[RouterB-Ethernet1]int s0
[RouterB-Serial0]ip addrress 10.68.1.1 255.255.0.0
[RouterB-Serial0]undo shutdown
[RouterB-Serial0]quit
[RouterB]ip routing
[RouterB]dis curr
[root@PCA root]#ifconfig eth0 10.65.1.1 netmask 255.255.0.0
[root@PCA root]#route add default gw 10.65.1.2
[root@PCA root]#ping 10.65.1.2 通
[root@PCA root]#ping 10.66.1.2 通
[root@PCA root]#ping 10.67.1.2 通
[root@PCA root]#ping 10.68.1.2 不通
[root@PCA root]#ping 10.69.1.2 不通
[RouterA]ip route-static 10.69.0.0 255.255.0.0 10.67.1.1
[root@PCA root]#ping 10.69.1.1 通
三个路由器的静态路由
设置RouterA的IP:
f0/0: 10.65.1.2 --->PCA:10.65.1.1
f0/1: 10.66.1.2 --->PCB:10.66.1.1
s0/0: 10.67.1.2
s0/1: 10.68.1.2 --->接RouterC s0/0
设置RouterC的IP:
s0/0: 10.68.1.1 <---
s0/1: 10.78.1.2 --->接RouterB s0/0
设置RouterB的IP:
s0/0: 10.78.1.1 <---
s0/1: 10.67.1.1
f0/0: 10.69.1.2 --->PCC:10.69.1.1
f0/1: 10.70.1.2 --->PCD:10.70.1.1
设置从PCA到PCC的静态路由
ROA(config)#ip routing
ROA(config)#ip route 10.69.0.0 255.255.0.0 10.68.1.1
ROA#show ip route
ROB(config)#ip route 10.69.0.0 255.255.0.0 10.78.1.1
ROB#show ip route
[root@PCA root]#ping 10.69.1.1 (通)
[root@PCA root]#ping 10.78.1.1 (不通)
[root@PCA root]#ping 10.70.1.1 (不通)
我们再做一个使用默认路由的小实验,先去掉原有的静态路由。
ROA(config)#no ip route 10.69.0.0 255.255.0.0 10.68.1.1
ROA#sh ip ro
ROB(config)#no ip route 10.69.0.0 255.255.0.0 10.78.1.1
ROB#sh ip ro
[root@PCA root]#ping 10.69.1.1 (不通)
ROA(config)#ip route 0.0.0.0. 0.0.0.0 10.68.1.1
ROA#sh ip ro
ROB(config)#ip route 0.0.0.0. 0.0.0.0 10.69.1.1
ROB#sh ip ro
[root@PCA root]#ping 10.69.1.1 (通)
[root@PCA root]#ping 10.70.1.1 (通)
[root@PCA root]#ping 10.78.1.1 (通)
[RouterB-Serial0]undo ip addrress 10.67.1.1 255.255.0.0
[RouterB-Serial0]ip addrress 10.70.1.1 255.255.0.0
[RouterC]interface serial0
[RouterC-Serial0]ip addrress 10.67.1.1 255.255.0.0
[RouterC-Serial0]undo shutdown
[RouterC-Serial0]clock rate 64000
[RouterC-Serial0]int s1
[RouterC-Serial1]ip addrress 10.70.1.1 255.255.0.0
[RouterC-Serial1]undo shutdown
[RouterC-Serial1]quit
[RouterC]ip route-static 10.69.0.0 255.255.0.0 10.70.1.1
[RouterC]dis curr
[root@PCA root]#ping 10.69.1.1 通
[root@PCA root]#ping 10.68.1.1 不通
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。