Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents

Configure DHCP Server or Relay on a Switch

date_range 26-Feb-25

This chapter lists the steps that are required to configure DHCP server or relay on a switch.

Prerequisites

Before configuring the DHCP server or relay, ensure the following:

  • The VLAN for which DHCP server will be configured on switch is assigned to the ports connecting to the DHCP clients. You can do this by applying a relevant port profile to the port. For more information about port profiles, see Port Profiles Overview.
  • The switch has a Static IP Configuration or Additional IP configuration for the network to run DHCP server. Or the L3 Interface is configured for DHCP server or relay.

Configure DHCP Server

To configure DHCP server on a switch:

  1. Navigate to Switches on the left menu and then click a Switch from the list.
    The switch details page is displayed.
  2. On the switch details page, scroll down to the DHCP Server / Relay tile in the Services section.
  3. On the DHCP Server / Relay tile, select the Enabled check box and then click Add DHCP Network.
    The DHCP Server / Relay configuration window is displayed.
  4. Ensure that Server is selected as configuration Type.
  5. From the Network drop-down list, select a network for the DHCP server.
  6. Specify the following fields:
    • IP Start—The starting IP address within the DHCP IP address assignment pool.

    • IP End—The ending IP address within the DHCP IP address assignment pool.

    • Gateway—Default gateway for the DHCP client. Usually, it is the switch IRB IP address for the corresponding network.

    • DNS Servers (Optional)—You can add up to three DNS IP addresses in a comma separated format.

    • DNS Suffix (Optional)—You can add up to three domain suffixes in a comma separated format.

    If you do not configure the DNS Servers and DNS Suffix, Mist auto-generates the configuration by taking DNS servers and DNS Suffix configured at the switch level.

  7. Save the changes.

    The following configuration will be applied to the API /sites/:site-id/devices/device-id:

    Check the corresponding intended configuration to be pushed to the following API: /sites/:site-id/devices/device-id/config_cmd

    The DHCP server is enabled on the irb.10 interface for the vl10.

    content_copy zoom_out_map
    set groups top system services dhcp-local-server group vl10 interface irb.10

    The address assignment pool configuration looks like the below:

    content_copy zoom_out_map
    "set groups top access address-assignment pool vl10 family inet network 10.0.0.0/24",
    "set groups top access address-assignment pool vl10 family inet range vl10 low 10.0.0.100",
    "set groups top access address-assignment pool vl10 family inet range vl10 high 10.0.0.200",
    "set groups top access address-assignment pool vl10 family inet dhcp-attributes name-server 8.8.8.8",
    "set groups top access address-assignment pool vl10 family inet dhcp-attributes name-server 8.8.4.4",
    "set groups top access address-assignment pool vl10 family inet dhcp-attributes name-server 1.0.0.1",
    "set groups top access address-assignment pool vl10 family inet dhcp-attributes router 10.0.0.10",
    "set groups top access address-assignment pool vl10 family inet dhcp-attributes option 15 array string test.net",
    "set groups top access address-assignment pool vl10 family inet dhcp-attributes option 15 array string tesing1.net",
    "set groups top access address-assignment pool vl10 family inet dhcp-attributes option 15 array string testing3.net,"
  8. Verify the configuration on the switch by using the following CLI:

    The DHCP clients for v110 networks should now be assigned IP address by DHCP server as shown below:

Here are some useful Junos CLI commands:

  • show dhcp server binding or show dhcp server binding detail—To view the DHCP server binding information.

  • show dhcp server statistics—To view the DHCP messages sent/received statistics.
  • clear dhcp server binding interface x-x/x/x—To clear the DHCP client binding for a client on a particular interface.
  • clear dhcp server binding <address>—To clear the DHCP client binding based on an IP address or MAC address of the wired client.

Configure DHCP Relay

To configure DHCP relay on a switch:

  1. Navigate to Switches on the left menu and then click a Switch from the List.
    The switch details page is displayed.
  2. On the switch details page, scroll down to the DHCP Server / Relay tile in the Services section.
  3. On the DHCP Server / Relay tile, select the Enabled check box and then click Add DHCP Network.
    The DHCP Server / Relay configuration window is displayed.
  4. Select Relay as configuration Type.
  5. From the Network drop-down list, select a network for the DHCP relay.
  6. In the DHCP Servers field, configure the IP address for the remote DHCP server. You can add up to three IP addresses in a comma separated format.
  7. Save the changes.

    The following configuration will be applied to the API /sites/:site-id/devices/device-id:

    Check the corresponding intended configuration to be pushed on following API: /sites/:site-id/devices/device-id/config_cmd

    The configuration looks like the below:

    content_copy zoom_out_map
    "set groups top forwarding-options dhcp-relay server-group v111 192.168.1.1",
    "set groups top forwarding-options dhcp-relay server-group v111 interface irb.11",
    "set groups top forwarding-options dhcp-relay server-group v111 active server group v111",
  8. Verify the configuration on the switch using the following CLI:
  9. Make sure the remote DHCP server is reachable from the switch.
  10. Verify DHCP relay binding on the switch.

Here are some useful Junos CLI commands:

  • show dhcp relay binding or show dhcp relay binding detail—To view the DHCP relay binding information.

  • show dhcp server statistics—To view the DHCP relay messages sent/received statistics.
  • clear dhcp relay binding interface x-x/x/x—To clear the DHCP client binding for a client on a particular interface.
  • clear dhcp relay binding <address>—To clear the DHCP client binding based on an IP address or MAC address of the wired client.

See also: DHCP Relay Agent.

file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
Configure DHCP Server or Relay on a Switch
keyboard_arrow_right
footer-navigation
keyboard_arrow_down
file_download
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
language