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

    我们将以上面的拓扑图进行静态路由的实验,实验目的是达到全网互通的效果

    所谓静态路由的下一跳也就是指定自己所在的路由器相邻路由器的那个离你最近的接口,以router0为例,相邻的路由器为router1,离router0最近的router1的接口是router1上的s0/3/0,这就是router0的下一跳所在

    router0:

    enbale  进入特权模式

    config t  进入全局配置模式

    interface l0(这里是L0)设置回环的ip地址

    ip address 192.168.1.1 255.255.255.0

    exit

    interface s0/3/0

    ip address 192.168.10.1 255.255.255.0

    clock rate 6400 (配置的DCE串口,设置同步时间)

    no shutdown

    exit

    在全局配置模式下配置静态路由

    ip route 192.168.2.0 255.255.255.0 192.168.10.2(你要去的目标网段和指定的下一跳的ip)

    ip route 192.168.20.0 255.255.255.0 192.168.10.2

    ip route 192.168.3.0 255.255.255.0 192.168.10.2

    router1:

    enbale  进入特权模式

    config t  进入全局配置模式

    interface l0(这里是L0)设置回环的ip地址

    ip address 192.168.2.1 255.255.255.0

    exit

    interface s0/3/1

    ip address 192.168.20.1 255.255.255.0

    clock rate 6400 (配置的DCE串口,设置同步时间)

    no shutdown

    exit

    interface s0/3/0

    ip address 192.168.10.2 255.255.255.0

    no shutdown

    exit

    在全局配置模式下配置静态路由

    ip route 192.168.1.0 255.255.255.0 192.168.10.1(你要去的目标网段和指定的下一跳的ip)

    ip route 192.168.3.0 255.255.255.0 192.168.20.2

    router3:

    enbale  进入特权模式

    config t  进入全局配置模式

    interface l0(这里是L0)设置回环的ip地址

    ip address 192.168.3.1 255.255.255.0

    exit

    interface s0/3/1

    ip address 192.168.20.2 255.255.255.0

    no shutdown

    exit

    在全局配置模式下配置静态路由

    ip route 192.168.2.0 255.255.255.0 192.168.20.1(你要去的目标网段和指定的下一跳的ip)

    ip route 192.168.10.0 255.255.255.0 192.168.20.1

    ip route 192.168.1.0 255.255.255.0 192.168.20.1

    这样全网互通就完成了!

  • 相关阅读:
    2190 ACM 数学概率论的乘法和加法原则
    2186 ACM 水题 int 向下取整
    2110 ACM Crisis of HDU 母函数
    2079 ACM 选课时间 背包 或 母函数
    2111 ACM 贪心 水题
    2108 ACM 向量积 凹凸
    My Web Developer Roadmap
    2109 ACM 排序
    2107 ACM 水题
    vi的常用命令
  • 原文地址:https://www.cnblogs.com/wuhaohao/p/9197479.html
Copyright © 2011-2022 走看看