Delaware Finance

Nov 30 2017

Example: Configuring the Device as a DHCP Server – Technical Documentation – Support – Juniper


#

TechLibrary

Example: Configuring the Device as a DHCP Server

Requirements

Before you begin:

  • Determine the IP address pools and the lease durations to use for each subnet.
  • Obtain the MAC addresses of the clients that require permanent IP addresses. Determine the IP addresses to use for these clients.
  • List the IP addresses that are available for the servers and devices on your network; for example, DNS, NetBIOS servers, boot servers, and gateway devices. See the Understanding Management Predefined Policy Applications .
  • Determine the DHCP options required by the subnets and clients in your network.

Overview

In this example, you configure the device as a DHCP server. You specify the IP address pool as 192.168.2.0/24 and from a low range of 192.168.2.2 to a high range of 192.168.2.254. You set the default-lease-time to 1,209,600 and the maximum-lease-time to 2,419,200. You then set the domain search suffixes as mycompany.net and mylab.net. These suffixes specify the domain search list used by a client when resolving hostnames with DNS.

Then you specify the DNS server IP address as 192.168.10.2. You set the IP address for the device solicitation address option (option 32) as 192.168.2.33. The IP address excluded from the IP address pool is reserved for this option. Finally, you assign a fixed IP address as 192.168.2.50 with the MAC address of the client, 01:03:05:07:09:0B.

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

set system services dhcp pool 192.168.2.0/24 address-range low 192.168.2.2 high 192.168.2.254set system services dhcp pool 192.168.2.0/24 default-lease-time 1209600 maximum-lease-time 2419200set system services dhcp pool 192.168.2.0/24 domain-search mycompany.netset system services dhcp pool 192.168.2.0/24 domain-search mylab.netset system services dhcp pool 192.168.2.0/24 name-server 192.168.10.2set system services dhcp pool 192.168.2.0/24 option 32 ip-address 192.168.2.33set system services dhcp static-binding 01:03:05:07:09:0B fixed-address 192.168.2.50

GUI Step-by-Step Procedure

To configure the device as a DHCP server:

  1. In the J-Web interface, select Configure Services DHCP Boot DHCP Relay .
  2. Next to System, click Configure .
  3. Next to Services, make sure the check box is selected, and click Configure .
  4. Next to Dhcp, click Configure .
  5. Define the IP address pool. Next to Pool, click Add new entry .
  6. In the Subnet address box, type 192.168.2.0/24 .
  7. Next to Address range, select the check box.
  8. In the High box, type 192.168.2.254 .
  9. In the Low box, type 192.168.2.2 .
  10. Click OK .
  11. Define the default and maximum lease times, in seconds. From the Default lease time list, select Enter Specific Value .
  12. In the Length box, type 1209600 .
  13. From the Maximum lease time list, select Enter Specific Value .
  14. Next to Maximum lease time, type 2419200 .
  15. Define the domain search suffixes to be used by the clients. Next to Domain search, click Add new entry .
  16. In the Suffix box, type mycompany.net .
  17. Click OK .
  18. Next to Domain search, click Add new entry .
  19. In the Suffix box, type mylab.net .
  20. Click OK .
  21. Define a DNS server. Next to Name server, click Add new entry .
  22. In the Address box, type 192.168.10.2 .
  23. Click OK .
  24. Define DHCP option 32, the device solicitation address option. Next to Option, click Add new entry .
  25. In the Option identifier code box, type 32 .
  26. From the Option type choice list, select Ip address .
  27. In the Ip address box, type 192.168.2.33 .
  28. Click OK twice.
  29. Assign a static IP address to a MAC address.Next to Static binding, click Add new entry .
  30. In the Mac address box, type 01:03:05:07:09:0B .
  31. Next to Fixed address, click Add new entry .
  32. In the Address box, type 192.168.2.50 .
  33. Click OK until you return to the Configuration page.
  34. Click OK to check your configuration and save it as a candidate configuration.
  35. If you are done configuring the device, click Commit Options Commit .

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode .

To configure the device as a DHCP server:

  1. Configure the DHCP server.
  • Specify the IP address pool range.
  • Define the default and maximum lease times, in seconds.
  • Define the domain search suffixes to be used by the clients.
  • Specify the DNS server IP address.
  • Set the device solicitation IP address.
  • Assign a fixed IP address with the MAC address of the client.

    Results

    From configuration mode, confirm your configuration by entering the show system services dhcp command. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

    If you are done configuring the device, enter commit from configuration mode.

    Verification

    Confirm that the configuration is working properly.

    Verifying Global DHCP Information

    Purpose

    Verify that the global DHCP Information has been configured for the device.

    Action

    From operational mode, enter the show system services dhcp global command.

    Verifying the DHCP Binding Database

    Purpose

    Verify that the DHCP binding database reflects the DHCP server configuration.

    Action

    From operational mode, enter these commands:

    • show system services dhcp binding command to display all active bindings in the database.
    • show system services dhcp binding address detail command (where address is the IP address of the client) to display more information about a client.
    • show system services dhcp conflict command to show any potential conflicts with the bindings.

    These commands produce following sample output:

    Verifying DHCP Server Operation

    Purpose

    Verify that the DHCP server operation has been configured.

    Action

    From operational mode, enter these commands:

    • ping command to verify that a client responds to ping packets containing the destination IP address assigned by the device.
    • ipconfig /all command to display the IP configuration on the client. For example, on a PC running Microsoft Windows, enter ipconfig /all at the command prompt to display the PC’s IP configuration.

  • Written by admin


    Leave a Reply

    Your email address will not be published. Required fields are marked *