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.
GUI Step-by-Step Procedure
To configure the device as a BOOTP/DHCP relay agent:
- In the J-Web user interface, select Configure>Services>DHCP>Boot DHCP Relay.
- Select the DHCP relay agent check box to enable the BOOTP/DHCP relay agent.
- Select the VPN encryption check box.
- In the Client response TTL box, type 20.
- In the Maximum hop count box, type 10.
- In the Minimum wait time box, type 300.
- In the Description box, type the description of the server.
- Add a new server. Next to Server, click Add new Entry.
- Next to the Name box, type 2.2.2.2.
- Define the routing instance. Next to Routing instance, click Add new entry.
- In the Name box, type rt-i-1 and click OK. A routing instance is optional.
- Add a new interface. Next to Interface, click Add new entry.
- In the Interface name box, type the interface name. For example, type ge-0/0/0.
- In the Client response TTL box, type 30.
- In the Description box, type the description of the server.
- Select the Dhcp option 82 check box.
- In the Maximum hop count box, type 20.
- In the Minimum wait time box, type 400.
- Select the No listen check box.
- Select the VPN encryption check box.
- Click OK until you return to the Configuration page.
- Click OK to check your configuration and save it as a candidate configuration.
- 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
.
To configure the device as a BOOTP or DHCP relay agent:
- Set the DHCP relay agent.[edit]user@host# edit forwarding-options helpers bootpuser@host# set relay agent-option
- Enable VPN encryption to allow client requests to pass
through VPN tunnel. [edit forwarding-options helpers bootp]user@host# set vpn
- Set the IP time-to-live value. .[edit forwarding-options helpers bootp]user@host# set client-response-ttl 20
- Set the maximum number of hops allowed per packet. [edit forwarding-options helpers bootp]user@host# set maximum-hop-count 10
- Set the minimum wait time in seconds. [edit forwarding-options helpers bootp]user@host# set minimum-wait-time 300
- Specify the description of the server. [edit forwarding-options helpers bootp]user@host# set description text
- Add a new server. [edit forwarding-options helpers bootp]user@host# set server 2.2.2.2
- Define the routing instance. [edit forwarding-options helpers bootp]user@host# set server 2.2.2.2 routing-instance rt-i-1
- Define the incoming BootP request forwarding interface.[edit forwarding-options helpers bootp]user@host# set interface ge-0/0/0
- Enable broadcast option.[edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set broadcast
- Define the IP time-to-live value. [edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set client-response-ttl 30
- Specify the description of the server. [edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set description text
- Set the DHCP option 82.[edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set dhcp-option82
- 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
- Set the minimum wait time.[edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set minimum-wait-time 400
- Set the no listen option.[edit forwarding-options helpers bootp interface ge-0/0/0]user@host# set no-listen
- 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.
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.
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

