实验九 静态路由实验

 
 
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 不通

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值