• 静态路由配置(Static Routing)


    1.按照试验拓扑,配置好路由器的各个接口IP;
    2.使用ping命令验证路由器之间的连同性,以R1为例:

    r1#ping 10.3.3.2

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 10.3.3.2, timeout is 2 seconds:
    !!!!!
    再用R1  ping  R2的loopback和R3的ip:
    r1#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 0 percent (0/5)
    略......
    R1无法ping通R2的loopback地址和R3的ip地址,需要添加静态路由。
    3.下面在3台路由器上使用命令ip route添加相应的静态路由:
    r1(config)#ip route 192.168.1.0 255.255.255.0 10.3.3.2  //设置静态路由到
    r1(config)#ip route 172.16.3.0 255.255.255.0 10.3.3.2
    r1(config)#ip route 172.16.1.0 255.255.255.0 10.3.3.2
    r1(config)#ip route 172.16.2.0 255.255.255.224 10.3.3.2

    r2(config)#ip route 10.1.1.0 255.255.255.0 10.3.3.1
    r2(config)#ip route 10.2.2.0 255.255.255.224 10.3.3.1
    r2(config)#ip route 172.16.1.0 255.255.255.0 172.16.3.1
    r2(config)#ip route 172.16.2.0 255.255.255.224 172.16.3.1

    r3(config)#ip route 192.168.1.0 255.255.255.0 172.16.3.2
    r3(config)#ip route 10.3.3.0 255.255.255.0 172.16.3.2
    r3(config)#ip route 10.1.1.0 255.255.255.0 172.16.3.2
    r3(config)#ip route 10.2.2.0 255.255.255.224 172.16.3.2
    然后再次验证:
    r1#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:
    !!!!!
    可以ping通。
    查看一下R1的路由表:
    r1#show ip route
    Codes: C - connected, S - static, 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
           i - IS-IS, su - IS-IS summary, 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

         172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
    S       172.16.1.0/24 [1/0] via 10.3.3.2
    S       172.16.2.0/27 [1/0] via 10.3.3.2
    S       172.16.3.0/24 [1/0] via 10.3.3.2
         10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
    C       10.3.3.0/24 is directly connected, Serial1/1
    C       10.2.2.0/27 is directly connected, Loopback1
    C       10.1.1.0/24 is directly connected, Loopback0
    S    192.168.1.0/24 [1/0] via 10.3.3.2
    S代表静态路由。(其余路由器略......)
    总结:其实如果路由器属于末梢节点的话,可以只用一条默认路由也可以实现上面的效果,例如R1:(企业上网常采用的默认路由)
    r1(config)#ip route 0.0.0.0 0.0.0.0 10.3.3.2

    这样也可以ping通其余的ip地址。
    OK,试验完!

    注:

    show run

    show ip route  查本台路由器路由表

    show ip interface bri  查本台路由器接口状态

    Loopback 0   虚拟接口

    总结:

    建立起经过各个网段的下一跳地址(出口)的路由表

  • 相关阅读:
    程序性能优化之布局检测与优化(二)下篇
    程序性能优化之布局检测与优化(二)上篇
    程序性能优化之启动速度与执行效率优化(一)下篇
    程序性能优化之启动速度与执行效率优化(一)上篇
    【前端图表】echarts散点图鼠标划过散点显示信息
    【干货】前端开发者最常用的六款IDE
    全网最全的小程序学习资料和文章,看这篇就够了
    Jquery+Ajax+Bootstrap Paginator实现分页的拼接
    推荐一款在线工具-程序员的工具箱
    推荐一款稳定快速免费的前端开源项目 CDN 加速服务
  • 原文地址:https://www.cnblogs.com/Ewin/p/1325847.html
Copyright © 2020-2023  润新知