DHCP

作者: _结弦 | 来源:发表于2024-09-13 09:21 被阅读0次

DHCP配置

DHCP 动态主机分配协议

global

[Huawei]dhcp en
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]ip pool 1
Info: It's successful to create an IP address pool.
# 配置ip域
[Huawei-ip-pool-1]network 192.168.1.0 mask 255.255.255.0
# 网关地址, 如果哪个接口使用了这个网关, 那么也就通过这个接口使用DHCP协议分配地址
[Huawei-ip-pool-1]gateway-list 192.168.1.1
# 排除dhcp能分配的地址, 现在也就是只有192.168.1.254可以分配
[Huawei-ip-pool-1]excluded-ip-address 192.168.1.2 192.168.1.253
[Huawei-ip-pool-1]dns-list 8.8.8.8
[Huawei-ip-pool-1]q
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[Huawei-GigabitEthernet0/0/0]dhcp select global 

interface

[Huawei-GigabitEthernet0/0/0]ip address 10.0.0.254 255.255.0.0
[Huawei-GigabitEthernet0/0/0]dhcp enable
[Huawei]interface g0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp server excluded-ip-address 10.0.0.254
Error:Please configure dhcp select interface first.
[Huawei-GigabitEthernet0/0/0]dhcp select interface
[Huawei-GigabitEthernet0/0/0]dhcp server excluded-ip-address 10.0.0.254
Error:Only idle or expired IP address can be disabled.
[Huawei-GigabitEthernet0/0/0]dhcp server excluded-ip-address 10.0.0.253
[Huawei-GigabitEthernet0/0/0]dhcp ?
  alarm     Alarm
  check     Check
  client    DHCP client
  option82  <Group> option82 command group
  relay     DHCP relay
  select    Select
  server    <Group> server command group
[Huawei-GigabitEthernet0/0/0]dhcp server ?
  dns-list             Configure DNS servers
  domain-name          Configure domain name 
  excluded-ip-address  Mark disable IP addresses 
  import               Imports the following network configuration parameters   
                       from a central server into local ip pool database: domain
                       name, dns server and netbios server.
  lease                Configure the lease of the IP pool
  nbns-list            Configure the windows's netbios name servers 
  netbios-type         Netbios node type
  next-server          The address of the server to use in the next step of the 
                       client's bootstrap process.
  option               Configure the DHCP options
  option121            DHCP option 121 
  option184            DHCP option 184
  recycle              Recycle IP address
  static-bind          Static bind
[Huawei-GigabitEthernet0/0/0]dhcp server lease day 8 hour 1 minute 0

difference between GLOBAL and INTERFACE

# global 会根据所有的地址池选择一个接口和网关相同的地址池(也就是自动选择)
[Huawei-GigabitEthernet0/0/0]dhcp select global 
# interface 需要自己手动指定
[Huawei-GigabitEthernet0/0/0]dhcp select interface
[Huawei-GigabitEthernet0/0/0] dhcp server ip-pool InterfacePool

6个包, 七个作用

  1. DHCPDiscover 发现DHCP服务器
  2. DHCPOffer 提供IP
  3. DHCPRequest 选择IP (广播)+ 续约(单播)
  4. DHCPAck 确认
  5. DHCPNack 拒绝
  6. DHCPDecline 发现地址冲突

相关文章

  • DHCP服务器

    DHCP服务 DHCP介绍 DHCP应用场景 DHCP工作原理 DHCP服务器部署 DHCP作用域 DHCP超级作...

  • dhcp

    1 DHCP概述 1.1 DHCP工作流程 发现阶段(DHCP DISCOVER) 即DHCP客户机寻找DHCP服...

  • DHCP

    cp /usr//share/doc/dhcp*/dhcpd.conf.sample /etc/dhcp/dhcp...

  • 2018-12-10DHCP的搭建

    DHCP服务的搭建 1,安装DHCP服务端 #yum -y install dhcp 2,配置dhcp服务器 #v...

  • Centos7搭建DHCP服务器

    一、DHCP服务简介 ****1. DHCP服务简介**** DHCP(Dynamic Host Configur...

  • DHCP报文类型以及流程

    客户端发送DHCP Discover广播信息寻找DHCP服务器 服务器收到DHCP Discover后发送DHCP...

  • DHCP原理与实现

    DHCP,DNS和HTTP是3种常见的高层协议。 一、动态主机配置协议DHCP 1、DHCP简介 DHCP(Dyn...

  • Linux之DHCP+tftp+syslinux+PXE+Cob

    Linux之DHCP+tftp+syslinux+PXE+Cobbler DHCP简介 DHCP全称为:Dynam...

  • 001 - DHCP报文类型

    DHCP报文类型 DHCP共有八种报文。 1、DHCP Discover DHCP客户端请求地址时,并不知道DHC...

  • 124由浅入深学网络--网络的安全应用

    DHCP Snooping 功能简介 DHCP Snooping 是 DHCP 的安全特性,以此来防御网络中不受信...

网友评论

    本文标题:DHCP

    本文链接:https://www.haomeiwen.com/subject/kgvmljtx.html