DHCP relay

1. Function Overview

The DHCP relay agent function forwards DHCP packets to the specified DHCP server.

3. Function Details

The operating specifications for the DHCP relay agent function are outlined below.

  1. The DHCP relay agent function of this product allows you to enable or disable the entire system and configure the forwarding destination for each interface.
    To enable the DHCP relay agent function on an interface, the system-wide settings must be enabled.

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

    • To set the forwarding destination, use the dhcp-relay server-address command in the corresponding interface mode.

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

    • System-wide settings: Disabled

    • Forwarding settings: None

  3. Configure the forwarding settings for the VLAN interface.

    • Configure the settings using the dhcp-relay server-address command.

    • DHCP packets received on the configured VLAN interface are forwarded to the specified IPv4 address.

    • The VLAN interface must have an IPv4 address configured.

    • Up to 32 VLAN interfaces can be configured.

  4. A broadcast address can be specified as the forwarding destination.

    • DHCP packets are forwarded to the broadcast address when the following conditions are met:
      At this point, the destination MAC address is "ff:ff:ff:ff:ff:ff".

      • The dhcp-relay broadcast command is enabled.

      • The broadcast address is set in the dhcp-relay server-address command.

    • Specify the address of the network directly connected to this product as the broadcast address.

      • Specifically, use the show ip route command to specify the network displayed as "directly connected."

    • For example, when sending to the 192.168.200.0/24 network, specify "192.168.200.255" as the broadcast address.

      • If you specify "192.168.200.0" (the network address) instead of "192.168.200.255", the same behavior will occur.

    • Only directed broadcast addresses can be specified as broadcast addresses.
      The limited broadcast addresses (255.255.255.255, 0.0.0.0) cannot be specified.

4. Related Commands

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

Operations Operating commands

Configuring the DHCP relay agent function

dhcp-relay

Setting the forwarding address for the DHCP relay agent function

dhcp-relay server-address

Configuring broadcast forwarding settings for the DHCP relay agent function

dhcp-relay broadcast

Displaying the DHCP relay agent status

show dhcp relay

5. Examples of Command Execution

5.1. Configuring the DHCP relay agent

Enable the DHCP relay agent to run on vlan1.
DHCP packets received from DHCP clients on vlan1 are forwarded to the DHCP server located on the vlan2 network.
The IP address of vlan1 is "192.168.100.240/24", the IP address of vlan2 is "192.168.200.240/24", and the IP address of the DHCP server is "192.168.200.1".
Assign vlan2 to port1.2.

■ 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 vlan2.

    Yamaha(config)#vlan database
    Yamaha(config-vlan)#vlan 2
  3. Set the IP address of vlan2 to "192.168.200.240/24".

    Yamaha(config)# interface vlan2
    Yamaha(config-if)# ip address 192.168.200.240/24
  4. Set port1.2 as an access port and assign it to vlan2.

    Yamaha(config)# interface port1.2
    Yamaha(config-if)# switchport access vlan 2
  5. Set the forwarding address on vlan1. Specify the DHCP server address.

    Yamaha(config)# interface vlan1
    Yamaha(config-if)# dhcp-relay server-address 192.168.200.1
  6. Activate the DHCP relay agent functions for the entire system.

    Yamaha(config-dhcp)# exit (1)
    Yamaha(config)# dhcp-relay enable (2)
    1 Exit the interface mode
    2 Enable the DHCP relay agent function for the entire system

6. Points of Caution

  • The VLAN in which the dhcp-relay server-address command is configured and the VLAN to which DHCP packets are forwarded must not be the same. Do not configure the dhcp-relay server-address command on the VLAN that receives the DHCP packets.

  • When using the AliasIP address function, addresses in the secondary IP address segment are not relayed by DHCP relay.