Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Configuring the Device as a BOOTP or DHCP Relay Agent

    This example shows how to configure the device as a BOOTP or DHCP relay agent.

    Requirements

    No special configuration beyond device initialization is required before configuring this feature.

    Overview

    In this example, you enable the DHCP relay agent to relay BOOTP or DHCP messages to a BOOTP server. You enable VPN encryption to allow client requests to pass through the VPN tunnel. You specify the IP time-to-live value to be set in responses to the client as 20. The range is from 1 through 255. You then set the maximum number of hops allowed per packet to 10. The range is from 4 through 16.

    Then you specify the minimum number of seconds before requests are forwarded as 300. The range is from 0 through 30,000 seconds. You set the description of the server (the value is a string), and you specify a valid server name or address to the server to forward (the value is an IPv4 address). You define the routing instance, whose value is a nonreserved text string of 128 or fewer characters. You then specify the incoming BOOTP or DHCP request forwarding interface as ge-0/0/0. You enable the broadcast option if the Layer 2 interface is unknown.

    You then specify the IP time-to-live value to be set in responses to the client as 30. The range is from 1 through 255. You set the description of the server as text and the DHCP option as 82. You set the maximum number of hops allowed per packet to 20 and specify the minimum number of seconds as 400 before requests are forwarded. You enable the no listen option. Finally, you enable VPN encryption to allow client requests to pass through the VPN tunnel.

    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 forwarding-options helpers bootp relay agent-optionset forwarding-options helpers bootp vpnset forwarding-options helpers bootp client-response-ttl 20set forwarding-options helpers bootp maximum-hop-count 10set forwarding-options helpers bootp minimum-wait-time 300set forwarding-options helpers bootp description textset forwarding-options helpers bootp server 2.2.2.2set forwarding-options helpers bootp server 2.2.2.2 routing instance rt-i-1set forwarding-options helpers bootp interface ge-0/0/0set forwarding-options helpers bootp interface ge-0/0/0 broadcastset forwarding-options helpers bootp interface ge-0/0/0 client-response-ttl 30set forwarding-options helpers bootp interface ge-0/0/0 description textset forwarding-options helpers bootp interface ge-0/0/0 dhcp-option82set forwarding-options helpers bootp interface ge-0/0/0 maximum-hop-count 20set forwarding-options helpers bootp interface ge-0/0/0 minimum-wait-time 400set forwarding-options helpers bootp interface ge-0/0/0 no-listenset forwarding-options helpers bootp interface ge-0/0/0 vpn

    GUI Step-by-Step Procedure

    To configure the device as a BOOTP/DHCP relay agent:

    1. In the J-Web user interface, select Configure>Services>DHCP>Boot DHCP Relay.
    2. Select the DHCP relay agent check box to enable the BOOTP/DHCP relay agent.
    3. Select the VPN encryption check box.
    4. In the Client response TTL box, type 20.
    5. In the Maximum hop count box, type 10.
    6. In the Minimum wait time box, type 300.
    7. In the Description box, type the description of the server.
    8. Add a new server. Next to Server, click Add new Entry.
    9. Next to the Name box, type 2.2.2.2.
    10. Define the routing instance. Next to Routing instance, click Add new entry.
    11. In the Name box, type rt-i-1 and click OK. A routing instance is optional.
    12. Add a new interface. Next to Interface, click Add new entry.
    13. In the Interface name box, type the interface name. For example, type ge-0/0/0.
    14. In the Client response TTL box, type 30.
    15. In the Description box, type the description of the server.
    16. Select the Dhcp option 82 check box.
    17. In the Maximum hop count box, type 20.
    18. In the Minimum wait time box, type 400.
    19. Select the No listen check box.
    20. Select the VPN encryption check box.
    21. Click OK until you return to the Configuration page.
    22. Click OK to check your configuration and save it as a candidate configuration.
    23. 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 in the Junos OS CLI User Guide PDF Document.

    To configure the device as a BOOTP or DHCP relay agent:

    1. Set the DHCP relay agent.
      [edit]user@host# edit forwarding-options helpers bootpuser@host# set relay agent-option
    2. Enable VPN encryption to allow client requests to pass through VPN tunnel.
      [edit forwarding-options helpers bootp]user@host# set vpn
    3. Set the IP time-to-live value. .
      [edit forwarding-options helpers bootp]user@host# set client-response-ttl 20
    4. Set the maximum number of hops allowed per packet.
      [edit forwarding-options helpers bootp]user@host# set maximum-hop-count 10
    5. Set the minimum wait time in seconds.
      [edit forwarding-options helpers bootp]user@host# set minimum-wait-time 300
    6. Specify the description of the server.
      [edit forwarding-options helpers bootp]user@host# set description text
    7. Add a new server.
      [edit forwarding-options helpers bootp]user@host# set server 2.2.2.2
    8. Define the routing instance.
      [edit forwarding-options helpers bootp]user@host# set server 2.2.2.2 routing-instance rt-i-1
    9. Define the incoming BootP request forwarding interface.
      [edit forwarding-options helpers bootp]user@host# set interface ge-0/0/0
    10. Enable broadcast option.
      [edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set broadcast
    11. Define the IP time-to-live value.
      [edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set client-response-ttl 30
    12. Specify the description of the server.
      [edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set description text
    13. Set the DHCP option 82.
      [edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set dhcp-option82
    14. Specify the maximum number of hops allowed per packet.
      [edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set forwarding-options helpers bootp interface ge-0/0/0 maximum-hop-count 20
    15. Set the minimum wait time.
      [edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set minimum-wait-time 400
    16. Set the no listen option.
      [edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set no-listen
    17. Enable VPN encryption to allow client requests to pass through the VPN tunnel.
      [edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set vpn

    Results

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

    [edit]user@host# show forwarding-optionshelpers {bootp {relay-agent-option;description text;server 2.2.2.2 routing-instance rt-i-1;maximum-hop-count 10;minimum-wait-time 300;client-response-ttl 20;vpn;interface {ge-0/0/0 {no-listen;broadcast;description text;maximum-hop-count 20;minimum-wait-time 400;client-response-ttl 30;vpn;dhcp-option82;}}}}

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

    Verification

    Confirm that the configuration is working properly.

    Verifying DHCP Relay Statistics

    Purpose

    Verify that the DHCP Relay statistics have been configured.

    Action

    From operational mode, enter the show system services dhcp relay-statistics command.

    user@host> show system services dhcp relay-statistics
    Received Packets:				4 Forwarded Packets               4 Dropped Packets                 4     Due to missing interface in relay database: 4    	Due to missing matching routing instance: 0     Due to an error during packet read: 0     Due to an error during packet send: 0     Due to invalid server address: 0     Due to missing valid local address: 0     Due to missing route to server/client: 0 

    Published: 2012-06-29