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

    拓扑图

    使用静态路由协议来实现不同网段间的通信

    首先为路由器的接口设置IP地址

    router 1 的配置

    Router>en

    Router#conf t

    Router(config)#int s0/1/0

    Router(config-if)#ip addr 192.168.10.1 255.255.255.0

    Router(config-if)#no shu

    进入虚拟接口 L0

    Router(config)#int l0

    Router(config-if)#ip addr 192.168.1.1 255.255.255.0

    Router(config-if)#exit

    router 2 的配置

    Router>en

    Router#conf t

    Router(config)#int s0/0/0

    Router(config-if)#ip addr 193.168.10.2 255.255.255.0

    Router(config-if)#clock rate 64000

    Router(config-if)#no shu

    Router(config)#int s0/0/1

    Router(config-if)#ip addr 193.168.20.1 255.255.255.0

    Router(config-if)#clock rate 64000

    Router(config-if)#no shu

    进入虚拟接口

    Router(config)#int l0

    Router(config-if)#ip addr 192.168.2.1 255.255.255.0

    Router(config-if)#exit

    router 3 的配置

    Router>en

    Router#conf t

    Router(config)#int s0/0/0

    Router(config-if)#ip addr 192.168.20.2 255.255.255.0

    Router(config-if)#no shu

    进入虚拟接口

    Router(config)#int l0

    Router(config-if)#ip addr 192.168.3.1 255.255.255.0

    Router(config-if)#exit

    IP地址配置完成后为路由器配置静态路由

    由于router 1和3 属于边缘路由所以只需要配置缺省路由即可

    router 1

    Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.2

    router 3

    Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.20.1

    router 2

    Router(config)#ip route 192.168.1.0  255.255.255.0  192.168.10.1
    Router(config)#ip route 192.168.3.0   255.255.255.0 192.168.20.2

    查看路由表

    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 192.168.10.2 to network 0.0.0.0
    C    192.168.1.0/24 is directly connected, Loopback0
    C    192.168.10.0/24 is directly connected, Serial0/1/0
    S*   0.0.0.0/0 [1/0] via 192.168.10.2
     
    使用 router 1 ping router 3
    Router#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 = 1/7/11 ms
     
    可以通信,静态路由配置完成
  • 相关阅读:
    1010 Radix (25 分)(二分)【回顾】
    1089 Insert or Merge (25 分)(two pointers)【回顾】
    1084 Broken Keyboard (20 分)(字符串处理)
    Listener监听器之HttpSessionListener
    在IE中如何在用户直接关闭窗口前清除Session
    C#文件操作简单封装
    几个实用的对String类的扩展
    C# 数据加密解密
    在IIS6中配置asp.net MVC网站时HTTP 错误 500.21 Internal Server Error解决方案
    C#常用的正则表达式
  • 原文地址:https://www.cnblogs.com/knightysa/p/9187335.html
Copyright © 2011-2022 走看看