Adding a DHCP Scope to a Juniper Switch

Adding a DHCP Scope to a Juniper Switch

August 8, 2019, Author: Taylor

Using the information below, we will setup DHCP on the Juniper QFX5110. This tutorial is assuming that you have already setup VLAN’s and assigned them to whichever port. We will assume that the port in this instance is VLAN 152.

VLAN ID: 152

VLAN Name: AGENCY-DHCP

VLAN IP: 10.10.152.1/24

  1. Log into the switch VIA SSH/Console/Telnet/etc…
  2. Once logged in, enter the command line interface by typing CLI  and hitting enter.
  3. At the prompt, type configure

The remaining steps will show you how to add the DHCP scope to the switch. The name “AGENCY-DHCP” is purely for the context of this tutorial. Please use something that pertains to your use case.

  1. set system services dhcp-local-server group AGENCY-DHCP interface irb.152

Next, we must create an address pool for IP addresses to be assigned to clients.

  1. set access address-assignment pool AGENCY-DHCP family inet network 10.10.152.0/24

Next, we need to assign the low & high addresses to the DHCP scope for assignment. Again, here the names “AT-range-01” are just a suggestion based on the name of the scope, AGENCY-DHCP.

  1. set  access address-assignment pool AGENCY-DHCP family inet range AT-range-01 low 10.10.152.2 
  2. set  access address-assignment pool AGENCY-DHCP family inet range AT-range-01 high 10.10.152.254

Finally, we need to set the default gateway of the DHCP scope, set the refresh time, and add the name servers to the scope.

  1. set access address-assignment pool AGENCY-DHCP family inet dhcp-attributes router 10.10.152.1
  1. set access address-assignment pool AGENCY-DHCP family inet dhcp-attributes maximum-lease-time 86400

NOTE: 86400 seconds is 24 hours

UPDATE: Use 604800 seconds (7 days) to avoid DHCP issues.

  1. set access address-assignment pool AGENCY-DHCP family inet dhcp-attributes name-server 8.8.8.8

NOTE: 8.8.8.8 & 8.8.4.4 are Googles public DNS and are required for web traffic to flow correctly. If you are using this as a core switch, make sure to have a DNS server of some sort.

  1. commit

NOTES: When setting up the DHCP scope for phones, you need to use the Option 150 setting and specify the phone TFTP servers. The syntax of the command looks like this… (this is the setup for our current phone system). Again the names are irrelevant. Also, 10.10.48.5/6 is just an example, you will need to point to your own PBX.

set access address-assignment pool LEGACY-VOICE family inet dhcp-attributes option 150 array ip-address 10.10.48.5

set access address-assignment pool LEGACY-VOICE family inet dhcp-attributes option 150 array ip-address 10.10.48.6

SOURCES:

Configuring DHCP on Juniper Switches

DHCP – Option 150

Comments (0)