zoukankan      html  css  js  c++  java
  • 路由器配置——静态路由-回环地址测试

    一、实验目的: 使用静态路由协议实现全网互通

    二、拓扑图如下:

    三、具体操作步骤:

    R1路由器配置

    Router>en  --进入特权模式
    Router#conf t  --进去全局配置模式
    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.12.1 255.255.255.0  --为端口配置地址
    R1(config-if)#clock rate 6400  -- 配置的DCE串口,设置同步时间
    Unknown clock rate  
    R1(config-if)#no shutdown  --开启端口

    %LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
    R1(config-if)#interface l0  --进入L0虚拟端口(循环地址)

    R1(config-if)#ip address 192.168.1.1 255.255.255.0  --配置地址
    R1(config-if)#exit  --返回上一级
    R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2  --配置缺省路由
    R1(config)#end  --返回特权模式

    R2路由器配置

    Router>en  --进入特权模式
    Router#conf t  --进入全局配置模式
    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.12.2 255.255.255.0  --配置端口地址
    R2(config-if)#clock rate 6400  --配置DCE串口,设置同步时间
    Unknown clock rate
    R2(config-if)#no shutdown  --开启端口

    R2(config-if)#interface s0/0/1  --进入端口
    R2(config-if)#ip address 192.168.23.1 255.255.255.0  --配置端口地址
    R2(config-if)#clock rate 6400  --配置DCE串口,设置同步时间
    Unknown clock rate
    R2(config-if)#no shutdown  --开启端口

    %LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
    R2(config-if)#interface l0  --进入L0虚拟端口(循环地址)

    R2(config-if)#ip address 192.168.2.1 255.255.255.0  --配置端口地址
    R2(config-if)#exit  --返回上一级
    R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.12.1  --配置静态路由,上一跳地址R1
    R2(config)#ip route 192.168.3.0 255.255.255.0 192.168.23.2  --配置静态路由,下一条地址R3
    R2(config)#end  --返回特权模式

    R3路由器配置

    Router>en  --进入特权模式
    Router#conf t  --进入全局配置模式
    Enter configuration commands, one per line. End with CNTL/Z.
    Router(config)#hostname R3  --修改路由器名为R3
    R3(config)#interface s0/0/0  --进入端口
    R3(config-if)#ip address 192.168.23.2 255.255.255.0  --配置端口地址
    R3(config-if)#no shutdown  --开启端口

    R3(config-if)#interface l0  --进入虚拟端口L0(循环地址)

    R3(config-if)#ip address 192.168.3.1 255.255.255.0  --配置端口地址
    R3(config-if)#exit  --返回上一级
    R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.23.1  --配置缺省路由
    R3(config)#end  --返回特权模式

    四、验证:

    (1)查看R1路由表信息

    # show iproute

    R1#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 192.168.12.2 to network 0.0.0.0

    C 192.168.1.0/24 is directly connected, Loopback0
    C 192.168.12.0/24 is directly connected, Serial0/0/0
    S* 0.0.0.0/0 [1/0] via 192.168.12.2
    R1#

    (2)互R1R3ping虚拟地址,看是否全网互通

    # ping 192.168.3.1

    R1#ping 192.168.3.1

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 6/9/14 ms

    # ping 192.168.1.1

    R3#ping 192.168.1.1

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 2/7/10 ms

    全网互通成功

  • 相关阅读:
    String源码分析
    solr IK分词器
    solr安装
    hadoop HA集群搭建(亲测)
    dubbo-admin安装
    关于idea中使用lamb表达式报错:ambda expressions are not supported at this language level
    web项目数据存入mysql数据库中文乱码问题
    dom4j解析xml
    js监听键盘提交表单
    Location replace() 方法
  • 原文地址:https://www.cnblogs.com/evolve/p/9199523.html
Copyright © 2011-2022 走看看