DHCP Server/Relay Configuration for Managed Switch.

  • How to Configure the switch as DHCP Server/Relay for a Network –
  • Pre-Requisites for DHCP server or Relay configuration –
    • Make sure the VLAN for which DHCP server will be configured on switch is assigned to the port/s connecting to the DHCP clients.

Make sure switch has a Static IP Configuration or Additional IP configuration for Network to be running DHCP server.


Or

L3 Interface configured to be configured for DHCP Server/relay –

  • Configuring DHCP/Relay server
    Navigate to Switch > Click on Switch from the List > Services tab you’ll see DHCP Server/Relay

Click on “Enabled” then Click on Add DHCP Network

Configure a DHCP server

Type Server will be selected by default, from the Network drop-down select the Network to be running DHCP server for.

  • Enter the following Mandatory Fields-
    • IP Start – Start of the DHCP IP address assignment pool
    • IP End – End of 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 )

 

  • Optional Fields –
    • DNS Servers – Can add up to 3 comma-separated dns server IPs
    • DNS Suffix – Can add up to 3 comma-separated domain suffix

 

 

If the DNS Servers, DNS Suffix optional fields are not configured Mist will auto generate config by taking DNS servers, DNS Suffix configured on Switch level eg

Save the changes

The following config will be Applied on the API

/sites/:site-id/devices/device-id

  • Check the Corresponding intended config to be pushed on following API –
/sites/:site-id/devices/device-id/config_cmd

This Enables DHCP server on the irb.10 interface for the vl10

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

Address Assignment Pool config

"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",
  • Switch cli verifcation –

Some Useful JUNOS Cli commands :

to see the DHCP server binding information –

show dhcp server binding
show dhcp server binding detail

to see the DHCP messages sent/received statistics –

show dhcp server statistics

to clear dhcp client binding for a client/s on particular interface-

clear dhcp server binding interface x-x/x/x

to clear dhcp client binding based on IP address or MAC address of the wired client-

clear dhcp server binding <address>
  • How to Configure DHCP Relay for Network
    • Click on Add DHCP Network > Select the type as DHCP Relay
  • Select the Network for DHCP Relay from the drop Down

Configure the IP Address/s for Remote DHCP Server (Can add upto 3 DHCP server IPs)

Save the Changes.

 

Some Useful JUNOS Cli commands

To see the DHCP relay binding information

show dhcp relay binding
show dhcp relay binding detail

To see the DHCP relay messages sent/received statistics

show dhcp relay statistics

To clear dhcp client binding for a client/s on particular interface

clear dhcp relay binding interface x-x/x/x·

To clear dhcp client binding based on IP address or MAC address of the wired client-

clear dhcp relay binding <address>

Some Additional Resources –

Juniper TechLiberary Document for DHCP Server & Relay Configuration –
https://www.juniper.net/documentation/us/en/software/junos/dhcp/topics/topic-map/dhcp-server-configuration.html
https://www.juniper.net/documentation/us/en/software/junos/dhcp/topics/topic-map/dhcp-relay-agent-security-devices.html#id-example-minimum-dhcp-relay-agent-configuration

Platforms Supporting DHCP Server/relay –
https://apps.juniper.net/feature-explorer/parent-feature-info.html?pFKey=1328&pFName=Dynamic%20Host%20Configuration%20Protocol%20(DHCP)