zoukankan      html  css  js  c++  java
  • 路由器基础配置之路由重分布

    我们将以上面的拓扑图为例,实验rip和静态的路由重分布,pc0,pc1,pc2分属不同网段,让他们之间能够互相通信

    首先为pc机配置好IP地址和网关(前往别忘记配置网关)

    接下来配置路由器ip地址

    router0

    enable  进入特权模式

    config t  进入全局配置模式

    interface s0/2/0  进入接口模式

    ip address 192.168.20.2 255.255.255.0  配置ip地址

    clock rate 6400  设置同步时间

    no shu  激活接口

    exit

    interface s0/3/0

    ip address 192.168.60.2 255.255.255.0 

    clock rate 6400

    no shu

    exit

    interface s0/3/1

    ip address 192.168.50.2 255.255.255.0

    clock rate 6400

    no shu

    exit

    router1

    enable  进入特权模式

    config t  进入全局配置模式

    interface s0/2/0  进入接口模式

    ip address 192.168.40.1 255.255.255.0  配置ip地址

    clock rate 6400  设置同步时间

    no shu  激活接口

    exit

    interface s0/3/0

    ip address 192.168.10.2 255.255.255.0 

    clock rate 6400

    no shu

    exit

    interface s0/3/1

    ip address 192.168.60.1 255.255.255.0

    clock rate 6400

    no shu

    exit

    router2

    enable  进入特权模式

    config t  进入全局配置模式

    interface s0/2/0  进入接口模式

    ip address 192.168.40.2 255.255.255.0  配置ip地址

    clock rate 6400  设置同步时间

    no shu  激活接口

    exit

    interface s0/3/0

    ip address 192.168.30.2 255.255.255.0 

    clock rate 6400

    no shu

    exit

    interface s0/3/1

    ip address 192.168.50.1 255.255.255.0

    clock rate 6400

    no shu

    exit

    router3

    enable

    config t

    interface s0/3/0

    ip address 192.168.20.1 255.255.255.0

    no shu

    exit

    interface g0/0

    ip address 192.168.3.254 255.255.255.0

    no shu

    exit

    router4

    enable

    config t

    interface s0/3/0

    ip address 192.168.10.1 255.255.255.0

    no shu

    exit

    interface g0/0

    ip address 192.168.1.254 255.255.255.0

    no shu

    exit

    router5

    enable

    config t

    interface s0/3/0

    ip address 192.168.30.1 255.255.255.0

    no shu

    exit

    interface g0/0

    ip address 192.168.2.254 255.255.255.0

    no shu

    exit

    路由器IP地址配置完毕,开始配置路由器的rip,静态和重分布

    router0

    在全局配置模式下

    router rip

    ver2

    network 192.168.20.0

    network 192.168.50.0

    network 192.168.60.0

    redistribute static metric 1  配置静态路由的重分布,配置静态路由的重分布同时可以配置一条直连路由的重分布

    redistribute connected metric 1

    exit

    ip router 192.168.3.0 255.255.255.0 192.168.20.1  设置去往3.0网段的静态路由

    router1

    在全局配置模式下

    router rip

    ver2

    network 192.168.10.0

    network 192.168.40.0

    network 192.168.60.0

    redistribute static metric 1  配置静态路由的重分布,配置静态路由的重分布同时可以配置一条直连路由的重分布

    redistribute connected metric 1

    exit

    ip router 192.168.1.0 255.255.255.0 192.168.10.1  设置去往1.0网段的静态路由

    router2

    在全局配置模式下

    router rip

    ver2

    network 192.168.40.0

    network 192.168.50.0

    network 192.168.30.0

    redistribute static metric 1  配置静态路由的重分布,配置静态路由的重分布同时可以配置一条直连路由的重分布

    redistribute connected metric 1

    exit

    ip router 192.168.2.0 255.255.255.0 192.168.30.1  设置去往2.0网段的静态路由

    router3

    在全局配置模式下

    ip router 192.168.1.0 255.255.255.0 192.168.20.2  设置去往1.0网段的静态路由

    ip router 192.168.2.0 255.255.255.0 192.168.20.2  设置去往2.0网段的静态路由

    router3不是边界路由器,无需设置重分布

    router4

    在全局配置模式下

    ip router 192.168.3.0 255.255.255.0 192.168.10.2  设置去往3.0网段的静态路由

    ip router 192.168.2.0 255.255.255.0 192.168.10.2  设置去往2.0网段的静态路由

    router4不是边界路由器,无需设置重分布

    router5

    在全局配置模式下

    ip router 192.168.1.0 255.255.255.0 192.168.30.2  设置去往1.0网段的静态路由

    ip router 192.168.3.0 255.255.255.0 192.168.30.2  设置去往3.0网段的静态路由

    router5不是边界路由器,无需设置重分布

    到此路由的重分布就完成了,可以在各个路由器上在特权模式下用show ip router来查看当前的路由表

    现在pc1,pc2,cp3之间是可以相互ping同的,到此,试验成功

  • 相关阅读:
    C++中重载、重定义、重写概念辨析
    虚函数,抽象函数
    取出一个int的每一位,用算法
    Typedef和define
    枚举
    基于 ThinkPHP 3.2.3 的页面静态化功能的实现
    骑行在华盛顿 针对320万次共享单车骑行数据的分析
    骑行在华盛顿 针对320万次共享单车骑行数据的分析
    分析了10个垂直行业后,告诉你大数据应用面临哪些挑战
    分析了10个垂直行业后,告诉你大数据应用面临哪些挑战
  • 原文地址:https://www.cnblogs.com/wuhaohao/p/9216917.html
Copyright © 2011-2022 走看看