zoukankan      html  css  js  c++  java
  • 静态路由 (2)

    拓扑图

    使用静态路由来确保不同网段的通信

    为路由器和电脑设置IP地址

    router 1 的设置

    Router>en
    Router#conf t
    Router(config)#int f0/0
    Router(config-if)#ip addr 192.168.1.2 255.255.255.0
    Router(config-if)#no shu
    Router(config-if)#
    Router(config)#int s0/3/0
    Router(config-if)#ip addr 192.168.20.1 255.255.255.0
    Router(config-if)#no shu
    Router(config-if)#int s0/3/1
    Router(config-if)#clock rate 64000
    Router(config-if)#ip addr 192.168.10.1 255.255.255.0
    Router(config-if)#no shu

     
    router  2 的设置
     
    Router>en
    Router#conf t
    Router(config)#
    Router(config)#int f0/0
    Router(config-if)#ip addr 192.168.2.2 255.255.255.0
    Router(config-if)#no shu
    Router(config-if)#
    Router(config-if)#int s0/3/0
    Router(config-if)#ip addr 192.168.20.2 255.255.255.0
    Router(config-if)#clock rate 64000
    Router(config-if)#no shu
    Router(config-if)#
    Router(config-if)#int s0/3/1
    Router(config-if)#ip addr 192.168.30.1 255.255.255.0
    Router(config-if)#no shu
     
    router  3  的设置
     
    Router>
    Router>en
    Router#conf t
    Router(config)#int f0/0
    Router(config-if)#ip addr 192.168.3.1 255.255.255.0
    Router(config-if)#no shu
    Router(config-if)# 
    Router(config-if)#int s0/3/1
    Router(config-if)#ip addr 192.168.10.2 255.255.255.0
    Router(config-if)#no shu
    Router(config-if)#
    Router(config-if)#int s0/3/0
    Router(config-if)#clock rate 64000
    Router(config-if)#ip addr 192.168.30.2 255.255.255.0
    Router(config-if)#no shu
    Router(config-if)#
    Router(config)#
     
    为路由器配置静态路由
     
    router 1 的配置
     
    Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.20.2
    Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.10.2
     
    router 2 的配置
     
    Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.20.1
    Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.30.2
     
    router 3 的配置
     
    Router(config)#ip route 192.168.1.0  255.255.255.0 192.168.10.1
    Router(config)#ip route 192.168.2.0  255.255.255.0 192.168.30.1
     
    查看路由表
     
    router 1 的路由表·
     
    Router#show ip route
    Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
           E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
           i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
           * - candidate default, U - per-user static route, o - ODR
           P - periodic downloaded static route
    Gateway of last resort is not set
    C    192.168.1.0/24 is directly connected, FastEthernet0/0
    S    192.168.2.0/24 [1/0] via 192.168.20.2
    S    192.168.3.0/24 [1/0] via 192.168.10.2
    C    192.168.10.0/24 is directly connected, Serial0/3/1
    C    192.168.20.0/24 is directly connected, Serial0/3/0
    Router#
     
    router 2 的路由表
     
    Router#show ip route
    Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
           E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
           i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
           * - candidate default, U - per-user static route, o - ODR
           P - periodic downloaded static route
    Gateway of last resort is not set
    S    192.168.1.0/24 [1/0] via 192.168.20.1
    C    192.168.2.0/24 is directly connected, FastEthernet0/0
    S    192.168.3.0/24 [1/0] via 192.168.30.2
    C    192.168.20.0/24 is directly connected, Serial0/3/0
    C    192.168.30.0/24 is directly connected, Serial0/3/1
    Router#
     
    router 3 的路由表
     
    Router#show ip route
    Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
           E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
           i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
           * - candidate default, U - per-user static route, o - ODR
           P - periodic downloaded static route
    Gateway of last resort is not set
    S    192.168.1.0/24 [1/0] via 192.168.10.1
    S    192.168.2.0/24 [1/0] via 192.168.30.1
    C    192.168.3.0/24 is directly connected, FastEthernet0/0
    C    192.168.10.0/24 is directly connected, Serial0/3/1
    C    192.168.30.0/24 is directly connected, Serial0/3/0
    Router#
     
    用ping 来检查网络的连通性
    pc 1 ping pc 2
     

    pc 1 ping  pc 3

     实验完成

  • 相关阅读:
    dell 1464 升级固态硬盘ssd 记录
    asp微信点餐系统下载,asp微信扫码点餐支付,asp源码开发的mdb数据库
    asp获取微信jsdk微信地址收货人信息,asp获取微信收货人地址信息代码
    asp微信地图导航代码,微信公众号获取当前位置并导航到目的地,asp写的源码
    asp源码开发微信公众号关注自动获取粉丝信息入库,取消关注自删除粉丝信息代码
    asp源码demo下载:微信公众号支付企业付款到零钱功能asp源码下载案例
    微信会员卡asp版,asp源码开发的微信电子会员卡系统,免费下载
    asp宣传海报图片合成,asp图片二维码合成海报图片,二维码带参数合成图片
    asp版汽车金融分期贷款审批asp系统源码
    asp微信登陆源码,实现asp网站授权微信登录(获取用户信息,微信名头像openid等)
  • 原文地址:https://www.cnblogs.com/knightysa/p/9208699.html
Copyright © 2011-2022 走看看