• 路由器基础配置之dhcp配置


    我们将以上面的拓扑图为例,router9为dhcp的服务器,为pc4,5,6分配三个不同网段的地址,pool为要分配的三个地址池,我们要把pc4设置为12网段,pc5设置成34网段,pc6设置成56网段

    首先为路由器分配ip地址

    router9:

    en  进入特权模式

    config t  进入全局配置模式

    interface s0/3/0

    ip address 192.168.100.1 255.255.255.0

    no shu

    exit

    interface g0/0

    ip address 192.168.12.254 255.255.255.0

    no shu

    router10:

    en  进入特权模式

    config t  进入全局配置模式

    interface s0/3/0

    ip address 192.168.100.2 255.255.255.0

    clock rate 6400

    no shu

    exit

    interface s0/3/1

    ip address 192.168.200.1 255.255.255.0

    clock rate 6400

    no shu

    interface g0/0

    ip address 192.168.34.254 255.255.255.0

    no shu

    router11:

    en  进入特权模式

    config t  进入全局配置模式

    interface s0/3/0

    ip address 192.168.200.2 255.255.255.0

    no shu

    exit

    interface g0/0

    ip address 192.168.56.254 255.255.255.0

    no shu

    ip地址分配完毕,现在配置rip路由,方便路由器之间的通信

    router9

    在全局配置模式下

    router rip

    ver 2

    network 192.168.12.0

    network 192.168.100.0

    router10

    在全局配置模式下

    router rip

    ver 2

    network 192.168.34.0

    network 192.168.100.0

    network 192.168.200.0

    router11

    在全局配置模式下

    router rip

    ver 2

    network 192.168.200.0

    network 192.168.56.0

    rip配置完毕,现在开始配置dhcp,拓扑图中的路由器为思科的2911,在模拟器中。dhcp是默认开启的,所以我们直接定义地址池即可

    router9

    在全局配置模式下

    ip dhcp pool ccie  定义的地址池的名称

    network 192.168.12.0 255.255.255.0  定义地址段

    default-router 192.168.12.254  定义网关

    exit

    ip dhcp excluded-address 192.168.12.254 设置不分配的地址或者地址段,可写两个地址,这两个地址包括之间的地址都为排除的地址

    ip dhcp pool qqq  在定义一个地址池

    network 192.168.34.0 255.255.255.0

    default-router 192.168.34.254

    exit

    ip dhcp excluded-address 192.168.34.254

    ip dhcp pool abc 定义第三个地址池

    network 192.168.56.0 255.255.255.0

    default-router 192.168.56.254

    exit

    ip dhcp excluded-address 192.168.56.254

    router9的dhcp配置完毕,pc4已经可以分配,但pc5和pc6在其他路由器之下,所以我们这里需要用到dhcp中继

    router10

    在全局配置模式下

    interface g0/0

    ip helper-address 192.168.100.1  离dhcp路由器最近的那个dhcp路由器上的接口

    这样router10的中继就配置完毕了

    router11

    在全局配置模式下

    interface g0/0

    ip helper-address 192.168.100.1

    这样router11的中继也配置完成了,接下来就可以开启pc机的dhcp功能获取地址了

  • 相关阅读:
    旧文备份:CANopen协议PDO的几种传输方式
    CANopen 基础
    单片机FLASH与RAM、ROM的关系
    在CANopen网络中通过LSS服务设置节点地址和网络波特率
    STM32F103 CAN中断发送功能的再次讨论
    由RS-232串口到PROFIBUS-DP总线的转换接口设计
    profibus 的DPV0 和DPV1
    PROFIBUS-DP
    profibus总线和profibus dp的区别
    获取验证码倒计时
  • 原文地址:https://www.cnblogs.com/wuhaohao/p/9267296.html
Copyright © 2020-2023  润新知