zoukankan      html  css  js  c++  java
  • 路由器基础配置之静态路由

    拓扑图如下

    路由器1配置:

          Router>enable    进入特权模式
          Router#config terminal    进入全局配置模式
          Enter configuration commands, one per line. End with CNTL/Z.
          Router(config)#hostname R1    修改路由器名为R1
          R1(config)#interface S0/0/0    进入端口
        R1(config-if)#ip address 192.168.13.1 255.255.255.0    设置ip地址
             R1(config-if)#clock rate 64000    设置时钟速率
          This command applies only to DCE interfaces  
        R1(config-if)#no shutdown    激活端口

           %LINK-5-CHANGED: Interface Serial0/0/0, changed state to down

            R1(config-if)#interface s0/0/1    进入端口
            R1(config-if)#ip address 192.168.23.1 255.255.255.0    设置ip地址
          R1(config-if)#clock rate 64000    设置时钟速率
          R1(config-if)#no shutdown    激活端口

          %LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
          R1(config-if)#interface f0/0   进入端口
          R1(config-if)#ip address 192.168.1.254 255.255.255.0    设置ip地址
          R1(config-if)#no shutdown    激活端口

          R1(config-if)#exit    返回上一级
          R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.13.2   配置静态路由
          R1(config)#ip route 192.168.3.0 255.255.255.0 192.168.23.2
          R1(config)#ip route 192.168.12.0 255.255.255.0 192.168.13.2
          R1(config)#end    返回特权模式

    路由器2配置:

           Router>enable     进入特权模式
           Router#config terminal    进入全局配置模式
           Enter configuration commands, one per line. End with CNTL/Z.
           Router(config)#hostname R2    修改主机名为R2
           R2(config)#interface s0/0/0    进入端口
           R2(config-if)#ip address 192.168.13.2 255.255.255.0  --设置ip地址
           R2(config-if)#no shutdown    激活端口

           R2(config-if)#interface f0/0    进入端口
           R2(config-if)#ip address 192.168.2.254 255.255.255.0  --设置ip地址
           R2(config-if)#no shutdown    激活端口

           R2(config-if)#interface f0/1    进入端口
           R2(config-if)#ip address 192.168.12.2 255.255.255.0    设置ip地址
           R2(config-if)#no shutdown    激活端口

           R2(config-if)#exit    返回上一级
           R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.13.1    配置静态路由
           R2(config)#ip route 192.168.3.0 255.255.255.0 192.168.12.1
           R2(config)#ip route 192.168.23.0 255.255.255.0 192.168.13.1
           R2(config)#end    返回特权模式

    路由器3配置

           Router>enable    进入特权模式
           Router#config terminal    进入全局配置模式
           Enter configuration commands, one per line. End with CNTL/Z.
              Router(config)#hostname R3    修改主机名为R3

           R3(config)#interface s0/0/1    进入端口
           R3(config-if)#ip address 192.168.23.2 255.255.255.0  --设置ip地址
           R3(config-if)#no shutdown    激活端口

         R3(config-if)#interface f0/0    进入端口
         R3(config-if)#ip address 192.168.3.254 255.255.255.0  --设置ip地址
            R3(config-if)#no shutdown    激活端口

           R3(config-if)#interface f0/1    进入端口
           R3(config-if)#ip address 192.168.12.1 255.255.255.0  --设置ip地址
           R3(config-if)#no shutdown    激活端口

            R3(config-if)#exit       返回上一级
            R3(config)#ip route 192.168.1.0 255.255.255.0 192.168.23.1    设置静态路由
            R3(config)#ip route 192.168.23.0 255.255.255.0 192.168.12.2
            R3(config)#ip route 192.168.2.0 255.255.255.0 192.168.12.2

    设置完毕

  • 相关阅读:
    为初次使用linux设置 root密码
    linux如何改为汉化环境
    Linux 标准目录结构
    常用linux terminal 命令
    jquery 获取及设置input各种类型的值
    使用$.getJSON实现跨域ajax请求
    react 异步取数据
    PHP 全局变量
    PHP保存本地日志文件
    全端开发——css(选择器)
  • 原文地址:https://www.cnblogs.com/ruanjie/p/9220511.html
Copyright © 2011-2022 走看看