• 在CISCO路由器上配置DHCP与DHCP中继



    企业网络中DHCP环境的搭建

    企业DHCP需求描述:

       在大型企业中,一般都有很多个部门,各部门之间有时要求不能互通,这可以通过使用VLAN来解决,但是上千个人IP配置也是一件极大耗费人力的事。所以我们迫切需求一种全自动的,高效的配置方法,通过DHCP配置IP地址的方法很好地为我们解决了这个问题。

    网络拓扑如下:

    650) this.width=650;" onsubmit="" onchange="" onunload="" onselect="" onreset="">

    配置描述

      一般小中型企业的网络拓扑如上图所示,在核心交换下面,接接入层交换机,各部门划分不同的VLAN,此时我们假设在核心交换上或路由器上,或在核心交换上单独接一台DHCP服务器。如果在三层上直接配置DHCP,则无需配置DHCP中继,此时我们假设在路由器上配置DHCP服务,一般大型企业分层的网络拓扑中间都是要跨网段的所以一般都会用到DHCP。

    设备配置

    路由器配置

    ROUTER#en

    ROUTER#

    ROUTER#conf t

    Enter configuration commands, one per line.  End with CNTL/Z.

    ROUTER(config)#

    ROUTER(config)#no ip domain-lookup

    ROUTER(config)#

    ROUTER(config)#host R1

    R1(config)#

    R1(config)#int e0/0

    R1(config-if)#

    R1(config-if)#ip add 12.1.1.1 255.255.255.0   //和三层交换相连的接口

    R1(config-if)#

    R1(config-if)#no shutdown

    R1(config-if)#

    R1(config-if)#exit

    R1(config)#

    R1(config)#ip dhcp pool test1

    R1(dhcp-config)#

    R1(dhcp-config)#network 192.168.1.0 255.255.255.0          //vlan10的地址池

    R1(dhcp-config)#

    R1(dhcp-config)#default-router 192.168.1.1

    R1(dhcp-config)#

    R1(dhcp-config)#dns-server 1.1.1.1

    R1(dhcp-config)#

    R1(dhcp-config)#exit

    R1(config)#

    R1(config)#ip dhcp pool test2

    R1(dhcp-config)#

    R1(dhcp-config)#network 192.168.2.0 255.255.255.0         //vlan20的地址池

    R1(dhcp-config)#

    R1(dhcp-config)#default-router 192.168.2.1

    R1(dhcp-config)#

    R1(dhcp-config)#dns-server 2.2.2.2

    R1(dhcp-config)#

    R1(dhcp-config)#exit

    R1(config)#

    R1(config)#ip dhcp exclu

    R1(config)#ip dhcp excluded-address 192.168.1.1        //去除网关的IP

    R1(config)#

    R1(config)#ip dhcp excluded-address 192.168.2.1          //去除网关的IP

    R1(config)#

    R1(config)#ip route 192.168.1.0 255.255.255.0 12.1.1.2   //添加去往VLAN10的路由

    R1(config)#

    R1(config)#ip route 192.168.2.0 255.255.255.0 12.1.1.2  //添加去往VLAN20的路由

    三层交换机配置

    SWITCH#en

    SWITCH#

    SWITCH#conf t

    Enter configuration commands, one per line.  End with CNTL/Z.

    SWITCH(config)#

    SWITCH(config)#host SW1

    SW1(config)#

    SW1(config)#int e0/0

    SW1(config-if)#ip add 12.1.1.2 255.255.255.0   //和R1相连的接口

    SW1(config-if)#

    SW1(config-if)#no shutdown

    SW1(config-if)#

    SW1(config-if)#exit

    SW1(config)#

    SW1(config)#vlan 10

    SW1(config-vlan)#

    SW1(config-vlan)#name test1

    SW1(config-vlan)#

    SW1(config-vlan)#vlan 20

    % Applying VLAN changes may take few minutes.  Please wait...

    SW1(config-vlan)#

    SW1(config-vlan)#name test2

    SW1(config-vlan)#

    SW1(config-vlan)#int vlan 10

    % Applying VLAN changes may take few minutes.  Please wait...

    SW1(config-if)#ip add 192.168.1.1 255.255.255.0

    SW1(config-if)#ip helper

    SW1(config-if)#ip helper-address 12.1.1.1        //设置DHCP服务器地址

    SW1(config-if)#

    SW1(config-if)#int vlan 20

    SW1(config-if)#ip add 192.168.2.1 255.255.255.0

    SW1(config-if)#ip helper-address 12.1.1.1           //设置DHCP服务器地址

    SW1(config-if)#

    SW1(config-if)#exit

    SW1(config)#

    DHCP中继的配置已经好了,接下来在二层交换机配置相应的VLAN,把相应交换机端口加入相应VLAN,然后开启DHCP获取地址即可。

  • 相关阅读:
    java 笔记(6) static关键字
    java 笔记(5)接口,static
    java 笔记(4)抽象类与抽象方法
    java 笔记(3)多态 容易理解
    看穿CSS的定位技术
    揭开浮动布局的秘密(简略版)
    不可不知的CSS盒子模型(简略版)
    初学Java web 项目
    Eclipse快捷键
    JDBC连接数据库
  • 原文地址:https://www.cnblogs.com/kscnchina/p/2815209.html
Copyright © 2020-2023  润新知