# DHCP server

## 1. Function Overview

The DHCP server function assigns (leases) IPv4 addresses to DHCP clients.
Depending on the options, information such as the default gateway and DNS server can also be provided.

## 2. Definition of Terms Used

None

## 3. Function Details

The operating specifications for the DHCP server function are outlined below:

1. The DHCP server function of this product allows you to enable or disable the entire system, as well as for each interface.
   To enable the DHCP server function on an interface, the system-wide settings must be enabled.

   - To configure system-wide settings, use the dhcp-server command in global configuration mode.

   - To configure settings for each interface, use the dhcp-server command in the corresponding interface mode.

2. The default settings for the DHCP server function are as follows: (In the initial state, this function is not operating.)

   - System-wide settings: Disabled

   - Interface settings: Disabled

3. When configuring the DHCP server function settings for an interface, do so for the VLAN interface.

   - Configure the settings using the dhcp-server command.

   - The VLAN interface must have an IPv4 address configured.

   - This is disabled by default.

   - To assign IP addresses using the DHCP server function, the DHCP pool described below must be configured properly.

   - Up to 32 VLAN interfaces can be configured.

4. The DHCP pool determines the information distributed to DHCP clients.

   - Use the dhcp pool command to switch to DHCP mode and create a DHCP pool.

   - You can create up to 64 DHCP pools.

5. The following settings can be configured for the DHCP pool:

   - Specifying the network portion

   - IP address range to be assigned to clients

   - IP address assigned to a specific client

   - Lease time

   - Duplicate check for leased IP addresses

   - Default gateway address

   - DNS server

   - Domain name

   - Boot file name

   - Server containing boot files

   - User-defined DHCP options

     When dynamically assigning addresses as a DHCP server, it is necessary to set the network portion and the IP address to be assigned.
     You cannot configure multiple pools with the same network portion.

6. The IP address to be assigned must be within the network specified as the DHCP pool.
   Specify the network portion of the DHCP pool as follows:

   - If the DHCP client is on the same network as the VLAN interface with the DHCP server function to be enabled, specify the network of the IP address set on the VLAN interface.

   - When accepting requests from DHCP clients via a DHCP relay agent, specify the network to which the client belongs.

7. The IP address assigned to a specific client can be set using the bind host command.

   - The maximum number of bind host commands is 4096 across all pools.

8. When the DHCP server startup completes, the following log is output at the debug level.

   - "DHCPv4 server started up using the new configuration."

9. When the DHCP server receives a packet with Option 82 enabled, it can set the IP address to be distributed based on the remote-id, circuit-id, and subscriber-id.

   - You can use the dhcp class command to enter class mode and set each of the above ids.

     - You can create up to 16 DHCP classes.

   - You can use the dhcp pool class command to apply the class set by the above command to the pool.

     - You can create up to 16 DHCP classes.

     - If the contents of Option 82 match the id of the applied class, the settings within the DHCP pool class are used by the DHCP server.

   - The following settings can be made for the DHCP pool class:

     - IP address range to be assigned to clients

     - Lease time

     - Default gateway address

     - DNS server

     - Domain name

   - When passing through a device with DHCP snooping enabled, packets with Option 82 enabled are generated. For more information about DHCP snooping, refer to the link below.

     - DHCP Snooping

10. The following can be used for user-defined DHCP options.

    - You can define options with the option command.

      Option No. | Option Name | Mnemonics Available for Commands | Option Type
      --- | --- | --- | ---
      1 | Subnet Mask | subnet_mask | IP address
      2 | Time Offset | time_offset | 4-octet integer
      3 | Router | router | Array of IP addresses
      4 | Time Server | time_server | Array of IP addresses
      5 | Name Server | name_server | Array of IP addresses
      6 | Domain Name Server | dns | Array of IP addresses
      7 | Log Server | log_server | Array of IP addresses
      8 | Cookie Server | cookie_server | Array of IP addresses
      9 | LPR Server | lpr_server | Array of IP addresses
      10 | Impress Server | impress_server | Array of IP addresses
      11 | Resource Location Server | resource_location_server | Array of IP addresses
      12 | Host Name | hostname | String
      13 | Boot File Size | boot_file_size | 2-octet integer
      14 | Merit Dump File | merit_dump_file | String
      15 | Domain Name | domain | String
      16 | Swap Server | swap_server | IP address
      17 | Root Path | root_path | String
      18 | Extensions Pathname | extensions_pathname | String
      19 | IP Forwarding | ip_forwarding | Switch
      20 | Non-Local Source Routing | non_local_source_routing | Switch
      21 | Policy Filter | policy_filter | IP address array *An even number of IP addresses must be set, each consisting of an IP address and a mask.
      22 | Maximum Datagram Reassembly | maximum_datagram_reassembly | 2-octet integer
      23 | Default IP TTL | default_ip_ttl | 1-octet integer
      24 | Path MTU Aging Timeout | path_mtu_aging_timeout | 4-octet integer
      25 | Path MTU Plateau Table | path_mtu_plateau_table | Array of 2-octet integers
      26 | Interface MTU | interface_mtu | 2-octet integer
      27 | All Subnets are Local | all_subnets_are_local | Switch
      28 | Broadcast Address | broadcast_address | IP address
      29 | Perform Mask Discovery | perform_mask_discovery | Switch
      30 | Mask Supplier | mask_supplier | Switch
      31 | Perform Router Discovery | perform_router_discovery | Switch
      32 | Router Solicitation Address | router_solicitation_address | IP address
      33 | Static Route | static_route | IP address array *An even number of IP addresses must be set, each consisting of a pair of destination address and router address.
      34 | Trailer Encapsulation | trailer_encapsulation | Switch
      35 | Arp Cache Timeout | arp_cache_timeout | 4-octet integer
      36 | Ethernet Encapsulation | ethernet_encapsulation | Switch
      37 | TCP Default TTL | tcp_default_ttl | 1-octet integer
      38 | TCP Keepalive Interval | tcp_keepalive_interval | 4-octet integer
      39 | TCP Keepalive Garabage | tcp_keepalive_garbage | Switch
      40 | NIS Domain | nis_domain | String
      41 | NIS Server | nis_server | Array of IP addresses
      42 | NTP Server | ntp_server | Array of IP addresses
      44 | WINS Server | wins_server | Array of IP addresses
      45 | NBT-DD Server | nbt_dd_server | Array of IP addresses
      46 | NBT Node Type | nbt_node_type | 1-octet integer
      47 | NBT Scope | nbt_scope | String
      48 | X Font Server | x_font_server | Array of IP addresses
      49 | X Display Manager | x_display_manager | Array of IP addresses
      62 | Netware/IP Domain Name | netware_domain_name | String
      64 | NIS+ Domain | nis+_domain | String
      65 | NIS+ Server | nis+_server | Array of IP addresses
      66 | TFTP Server Name | tftp_server_name | String
      67 | Boot File Name | boot_file_name | String
      68 | Mobile IP Home Agent | mobile_ip_home_agent | Array of IP addresses
      69 | SMTP Server | smtp_server | Array of IP addresses
      70 | POP3 Server | pop3_server | Array of IP addresses
      71 | NNTP Server | nntp_server | Array of IP addresses
      72 | Default WWW Server | default_www_server | Array of IP addresses
      73 | Default Finger Server | default_finger_server | Array of IP addresses
      74 | Default IRC Server | default_irc_server | Array of IP addresses
      75 | StreetTalk Server | streettalk_server | Array of IP addresses
      76 | StreetTalk Directory Assistance Server | streettalk_directory_assistance_server | Array of IP addresses
      85 | NDS Server | nds_server | Array of IP addresses
      86 | NDS Tree Name | nds_tree_name | String
      87 | NDS Context | nds_context | String

## 4. Related Commands

Related commands are indicated below.
For details on the commands, refer to the Command Reference.

Operations | Operating commands
--- | ---
DHCP server function settings (system) | dhcp-server
DHCP server function settings (interface) | dhcp-server
DHCP server operation type settings | server-type
DHCP pool settings | dhcp pool
Network portion settings | network
Setting the range of IP addresses to be assigned (DHCP) | range
Setting IP addresses to be assigned to specific clients | bind host
Lease time settings (DHCP) | lease
Duplicate check settings for leased IP addresses | probe
Timeout settings for duplicate checks on leased IP addresses | probe timeout
Setting the default gateway address to notify (DHCP) | default-router
Setting the DNS server to notify (DHCP) | dns-server
Setting the Domain Name to Notify (DHCP) | domain-name
Boot file name settings | bootfile
Setting the server containing boot files | next-server
User-defined DHCP option settings | option
DHCP class settings | dhcp class
remote-id settings | remote-id
circuit-id settings | circuit-id
subscriber-id settings | subscriber-id
DHCP pool class settings | dhcp pool class
Setting the range of IP addresses to be assigned (DHCP pool class) | range
Lease time settings (DHCP pool class) | lease
Setting the default gateway address to notify (DHCP pool class) | default-router
Setting the DNS server to notify (DHCP pool class) | dns-server
Setting the domain name to notify (DHCP pool class) | domain-name
Show DHCP pool information | show dhcp pool
Show IP address allocation information for DHCP clients | show dhcp binding
Displaying the DHCP server status | show dhcp server
Deleting DHCP server lease information | clear dhcp-server lease

## 5. Examples of Command Execution

### 5.1. DHCP Server Settings

Enable the DHCP server to run on vlan1.
The DHCP client is assumed to be on the same network as the VLAN interface.
The IP address of vlan1 is "192.168.100.240/24", and the range of addresses to be distributed is "192.168.100.2-192.168.100.191/24".

■ Setting Procedure

1. Set the IP address of vlan1 to "192.168.100.240/24".

       Yamaha(config)# interface vlan1
       Yamaha(config-if)# ip address 192.168.100.240/24

2. Create the DHCP pool "pool_vlan1".

       Yamaha(config)# dhcp pool pool_vlan1
       Yamaha(config-dhcp)#  (1)

   1 | Switch to the DHCP mode

3. Specify the vlan1 network portion 192.168.100.0/24 as the DHCP pool.

       Yamaha(config-dhcp)# network 192.168.100.0/24

4. Set the address range to distribute, “192.168.100.2-192.168.100.191” as the DHCP pool.

       Yamaha(config-dhcp)# range 192.168.100.2 192.168.100.191

5. Specify the default gateway to be notified in DHCP option settings and specify the DNS server in the DHCP pool.

       Yamaha(config-dhcp)# default-router 192.168.100.240 (1)
       Yamaha(config-dhcp)# dns-server 192.168.100.1 (2)

   1 | The default gateway address is 192.168.100.240 (its own address)
   2 | The DNS server address is 192.168.100.1

6. Activate the DHCP server functions on vlan1.

       Yamaha(config-dhcp)# exit (1)
       Yamaha(config)# interface vlan1 (2)
       Yamaha(config-if)# dhcp-server enable (3)

   1 | Exit the DHCP mode
   2 | Switch to interface mode vlan1
   3 | Enable the DHCP server functions for the interface

7. Activate the DHCP server functions for the entire system.

       Yamaha(config-dhcp)# exit (1)
       Yamaha(config)# dhcp-server enable (2)

   1 | Exit the interface mode
   2 | Enable the DHCP server functions for the entire system

### 5.2. DHCP Server Option 82 Settings

The DHCP client is assumed to be on the same network as the VLAN interface.
The IP address of vlan1 is "192.168.100.240/24", and the range of addresses to be distributed is "192.168.100.2-192.168.100.191/24".
If the remote-id of Option 82 of the received packet matches the setting for "Customer_A", distribute from "192.168.100.200-192.168.100.210/24".

■ Setting Procedure

1. Set the IP address of vlan1 to "192.168.100.240/24".

       Yamaha(config)# interface vlan1
       Yamaha(config-if)# ip address 192.168.100.240/24

2. Create a DHCP class "Customer_A".

       Yamaha(config)# dhcp class Customer_A
       Yamaha(config-dhcp-class)#  (1)

   1 | Switch to DHCP class mode

3. Set the remote-id for the target DHCP class.

       Yamaha(config-dhcp-class)#remote-id 00:06:ac:44:f2:00:00:01

4. Create a DHCP pool "pool1".

       Yamaha(config)# dhcp pool pool1
       Yamaha(config-dhcp)#  (1)

   1 | Switch to the DHCP mode

5. Specify the vlan1 network portion 192.168.100.0/24 as the DHCP pool.

       Yamaha(config-dhcp)# network 192.168.100.0/24

6. Set the address range to distribute, “192.168.100.2-192.168.100.191” as the DHCP pool.

       Yamaha(config-dhcp)# range 192.168.100.2 192.168.100.191

7. Apply the class “Customer_A” set with the dhcp class command to the DHCP pool “pool1”.

       Yamaha(config-dhcp)#dhcp pool class Customer_A
       Yamaha(config-dhcp-pool-class)#  (1)

   1 | Switch to DHCP pool class mode

8. Set the IP address range to be assigned to “Customer_A”.

       Yamaha(config-dhcp-pool-class)#range 192.168.100.200 192.168.100.210

9. For “Customer_A”, set the default gateway and DNS server to be notified in the DHCP options in the DHCP pool class.

       Yamaha(config-dhcp-pool-class)#default-router 192.168.100.220 (1)
       Yamaha(config-dhcp-pool-class)#dns-server 192.168.100.230 (2)

   1 | The default gateway address is 192.168.100.220
   2 | The DNS server address is 192.168.100.230

10. Activate the DHCP server functions on vlan1.

        Yamaha(config-dhcp-pool-class)# exit (1)
        Yamaha(config-dhcp)# exit (2)
        Yamaha(config)# interface vlan1 (3)
        Yamaha(config-if)# dhcp-server enable (4)

    1 | Exit the DHCP pool class mode
    2 | Exit the DHCP mode
    3 | Switch to interface mode vlan1
    4 | Enable the DHCP server functions for the interface

11. Activate the DHCP server functions for the entire system.

        Yamaha(config-dhcp)# exit (1)
        Yamaha(config)# dhcp-server enable (2)

    1 | Exit the interface mode
    2 | Enable the DHCP server functions for the entire system

## 6. Points of Caution

- When using the AliasIP address function, addresses in the secondary IP address segment cannot be distributed via DHCP.

## 7. Related Documentation

- DHCP relay

Search result
No more search results.
There are no topics that match your search query.