CCNA 实验二 静态路由和默认路由

小鱼儿 2023-06-26 10:45 25阅读 0赞

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM0ODg5NjA3_size_16_color_FFFFFF_t_70

  1. 实验要求:
  2. 1PC1LAN1中,PC2LAN2中,配置静态路由实现两个LAN中的PC能够通信;
  3. 2、去掉静态路由,配置默认路由使PC1PC2能够通信;

1、PC1在LAN1中,PC2在LAN2中,配置静态路由实现两个LAN中的PC能够通信;

  1. # Router1
  2. Router>enable
  3. Router#configure terminal
  4. Router(config)#hostname R-1
  5. R-1(config)#interface f0/1
  6. R-1(config-if)#ip address 10.10.10.254 255.255.255.0
  7. R-1(config-if)#no shutdown
  8. R-1(config-if)#interface f0/0
  9. R-1(config-if)#ip address 10.10.20.253 255.255.255.0
  10. R-1(config-if)#no shutdown
  11. R-1(config-if)#exit
  12. R-1#show ip interface brief
  13. R-1#show ip route
  14. R-1#configure terminal
  15. R-1(config)#ip route 10.10.30.0 255.255.255.0 10.10.20.254
  16. R-1(config)#ip route 10.10.40.0 255.255.255.0 10.10.20.254
  17. R-1(config)#exit
  18. R-1#show ip route
  19. R-1#write
  20. # Router2
  21. Router>enable
  22. Router#configure terminal
  23. Router(config)#hostname R-2
  24. R-2(config)#interface f0/0
  25. R-2(config-if)#ip address 10.10.20.254 255.255.255.0
  26. R-2(config-if)#no shutdown
  27. R-2(config-if)#interface f0/1
  28. R-2(config-if)#ip address 10.10.30.253 255.255.255.0
  29. R-2(config-if)#no shutdown
  30. R-2(config-if)#exit
  31. R-2#show ip interface brief
  32. R-2#show ip route
  33. R-2#configure terminal
  34. R-2(config)#ip route 10.10.10.0 255.255.255.0 10.10.20.253
  35. R-2(config)#ip route 10.10.40.0 255.255.255.0 10.10.30.254
  36. R-2(config)#exit
  37. R-2#show ip route
  38. R-2#write
  39. # Router3
  40. Router>enable
  41. Router#configure terminal
  42. Router(config)#hostname R-3
  43. R-3(config)#interface f0/1
  44. R-3(config-if)#ip address 10.10.30.254 255.255.255.0
  45. R-3(config-if)#no shutdown
  46. R-3(config-if)#interface f0/0
  47. R-3(config-if)#ip address 10.10.40.254 255.255.255.0
  48. R-3(config-if)#no shutdown
  49. R-3(config-if)#exit
  50. R-3#show ip interface brief
  51. R-3#show ip route
  52. R-3#configure terminal
  53. R-3(config)#ip route 10.10.10.0 255.255.255.0 10.10.30.253
  54. R-3(config)#ip route 10.10.20.0 255.255.255.0 10.10.30.253
  55. R-3(config)#exit
  56. R-3#show ip route
  57. R-3#write

2、去掉静态路由,配置默认路由使PC1与PC2能够通信;

  1. 首先,需要取消之前设置的静态路由
  2. # Router1
  3. R-1>enable
  4. R-1#show ip route
  5. R-1#configure terminal
  6. R-1(config)#no ip route 10.10.30.0 255.255.255.0 10.10.20.254
  7. R-1(config)#no ip route 10.10.40.0 255.255.255.0 10.10.20.254
  8. R-1(config)#exit
  9. R-1#show ip route
  10. R-1#write
  11. # Router2
  12. R-2>enable
  13. R-2#show ip route
  14. R-2#configure terminal
  15. R-2(config)#no ip route 10.10.10.0 255.255.255.0 10.10.20.253
  16. R-2(config)#no ip route 10.10.40.0 255.255.255.0 10.10.30.254
  17. R-2(config)#exit
  18. R-2#show ip route
  19. R-2#write
  20. # Router3
  21. R-3>enable
  22. R-3#show ip route
  23. R-3#configure terminal
  24. R-3(config)#no ip route 10.10.10.0 255.255.255.0 10.10.30.253
  25. R-3(config)#no ip route 10.10.20.0 255.255.255.0 10.10.30.253
  26. R-3(config)#exit
  27. R-3#show ip route
  28. R-3#write
  29. 下面开始配置默认路由
  30. # Router1
  31. R-1#configure terminal
  32. R-1(config)#
  33. R-1(config)#ip r
  34. R-1(config)#ip route 0.0.0.0 0.0.0.0 10.10.20.254
  35. R-1(config)#exit
  36. R-1#show ip route
  37. R-1#write
  38. # Router2
  39. R-2#configure terminal
  40. R-2(config)#ip route 0.0.0.0 0.0.0.0 10.10.20.253
  41. R-2(config)#ip route 0.0.0.0 0.0.0.0 10.10.30.254
  42. R-2(config)#exit
  43. R-2#show ip route
  44. R-2#write
  45. # Router3
  46. R-3#configure terminal
  47. R-3(config)#ip route 0.0.0.0 0.0.0.0 10.10.30.253
  48. R-3(config)#exit
  49. R-3#show ip route
  50. R-3#write

pc1、pc2 设置好ip、子网掩码、网关后,进行相应测试,这里就不一一列举出来了。

华为路由器配置静态路由&默认路由请参考:https://blog.csdn.net/qq_34889607/article/details/103858505

发表评论

表情:
评论列表 (有 0 条评论,25人围观)

还没有评论,来说两句吧...

相关阅读