Configuring DHCP with a Configuration Editor
This section contains the following topics:
- Configuring the Device as a DHCP Server
- Configuring the Device as a DHCP Client
- Configuring the Device as a BootP/DHCP Relay Agent
Configuring the Device as a DHCP Server
A typical DHCP server configuration provides the following configuration settings for a particular subnet on a device interface:
- An IP address pool, with one address excluded from the pool.
- Default and maximum lease times.
- Domain search suffixes. These suffixes specify the domain search list used by a client when resolving hostnames with DNS. See RFC 3397, Dynamic Host Configuration Protocol (DHCP) Domain Search Option, for more information.
- A DNS name server.
- A DHCP option—Router solicitation address option (option 32). The IP address excluded from the IP address pool is reserved for this option.
In addition, the DHCP server might assign a static address to at least one client on the subnet. Table 40 provides the settings and values for the sample DHCP server configuration used in this section.
Table 40: Sample DHCP Configuration Settings
Settings | Sample Value or Values |
|---|---|
| DHCP Subnet Configuration | |
Address pool subnet address | 192.168.2.0/24 |
High address in the pool range | 192.168.2.254 |
Low address in the pool range | 192.168.2.2 |
Address pool default lease time, in seconds | 1,209,600 (14 days) |
Address pool maximum lease time, in seconds | 2,419,200 (28 days) |
Domain search suffixes | mycompany.net mylab.net |
Address to exclude from the pool | 192.168.2.33 |
DNS server address | 192.168.10.2 |
Identifier code for router solicitation address option | 32 |
Type choice for router solicitation address option | Ip address |
IP address for router solicitation address option | 192.168.2.33 |
| DHCP MAC Address Configuration | |
Static binding MAC address | 01:03:05:07:09:0B |
Fixed address | 192.168.2.50 |
To configure the device as a DHCP server for a subnet and a single client:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 41.
- If you are finished configuring the device, commit the configuration.
- To verify DHCP server configuration and operation, see Verifying a DHCP Configuration.
Table 41: Configuring the Device as a DHCP Server
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Dhcp server level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit system services dhcp |
Define the IP address pool. |
| Set the IP address pool range: set pool 192.168.2.0/24 address-range low 192.168.2.2 high 192.168.2.254 |
Define the default and maximum lease times, in seconds. |
| Set the default and maximum lease times: set pool 192.168.2.0/24 default-lease-time 1209600 maximum-lease-time 2419200 |
Define the domain search suffixes to be used by the clients. |
| Set the domain search suffixes: set pool 192.168.2.0/24 domain-search mycompany.net set pool 192.168.2.0/24 domain-search mylab.net |
Define a DNS server. |
| Set the DNS server IP address: set pool 192.168.2.0/24 name-server 192.168.10.2 |
Define DHCP option 32—the router solicitation address option. |
| Set the router solicitation IP address: set pool 192.168.2.0/24 option 32 ip-address 192.168.2.33 |
Assign a static IP address of 192.168.2.50 to MAC address 01:03:05:07:09:0B. |
| Associate a fixed IP address with the MAC address of the client: set static-binding 01:03:05:07:09:0B fixed-address 192.168.2.50 |
Configuring the Device as a DHCP Client
To configure the J Series or SRX Series device as a DHCP client:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 42.
- If you are finished configuring the device, commit the configuration.
- To verify DHCP client configuration and operation, see Verifying the DHCP Client.
Table 42: Configuring the Device as a DHCP Client
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Interfaces level in the configuration hierarchy, and select the interface on which to configure DHCP client information—for example, ge-0/0/1.0. |
| From the [edit] hierarchy level, enter set interfaces ge-0/0/1 unit 0 family inet dhcp |
Configure the DHCP client identifier as either an ASCII or hexadecimal value. Use hexadecimal if the client identifier is a MAC address—for example, 00:0a:12:00:12:12. |
| Set the DHCP client identifier as a hexadecimal value: set interfaces ge-0/0/1 unit 0 family inet dhcp client-identifier 00:0a:12:00:12:12 |
Set the DHCP lease time in seconds—for example, 86400 (24 hours). The range is 60 through 2147483647 seconds. |
| Set the DHCP lease time to 86400 seconds: set interfaces ge-0/0/1 unit 0 family inet dhcp lease-time 86400 |
Define the number of attempts allowed to retransmit a DHCP packet—for example, 6. The range is 0 through 6. The default is 4 times. | In the Retransmission attempt box, type 6. | Set the number of attempts allowed to retransmit a DHCP packet to 6: set interfaces ge-0/0/1 unit 0 family inet dhcp retransmission-attempt 6 |
Define the interval, in seconds, allowed between retransmission attempts—for example, 5. The range is 4 through 64. The default is 4 seconds. | In the Retransmission interval box, type 5. | Set the interval allowed between retransmission attempts to 5 seconds: set interfaces ge-0/0/1 unit 0 family inet dhcp retransmission-interval 5 |
Set the IPv4 address of the preferred DHCP server—for example, 10.1.1.1. | In the Server address box, type 10.1.1.1. | Set the IPv4 address of the preferred DHCP server to 10.1.1.1: set interfaces ge-0/0/1 unit 0 family inet dhcp server-address 10.1.1.1 |
Set the vendor class ID for the DHCP client—for example, ether. |
| Set the vendor class ID to ether: set interfaces ge-0/0/1 unit 0 family inet dhcp vendor-id ether |
Configuring the Device as a DHCP Relay Agent
You can configure the device or an interface to act as a DHCP relay agent. Doing so enables the device to respond to DHCP or BOOTP requests broadcast by request as a broadcast message. If the device or an interface detects a broadcast message, it relays the message to a specified DHCP or BOOTP server.
We recommend you to configure the device or an interface to be a DHCP/BOOTP relay agent if you have locally attached hosts and a distant DHCP or BOOTP server. For more information, see Junos Policy Framework Configuration Guide
Configuring the Device as a BootP/DHCP Relay Agent
To configure the J Series or SRX Series device as a BootP/DHCP relay agent:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 43.
- If you are finished configuring the device, commit the configuration.
- To verify DHCP client configuration and operation, see Displaying DHCP Relay Statistics.
Table 43: Configuring the Device as a BootP/DHCP Relay Agent
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Forwarding-options level in the configuration hierarchy, and select the interface on which to configure the BootP/DHCP relay agent information. | In the J-Web interface, select Configure>Services>DHCP>Boot DHCP Relay. | From the [edit] hierarchy level, enter set forwarding-options helpers bootp |
Enable the DHCP relay agent to relay bootp/DHCP messages to BootP server. | Select the DHCP relay agent check box to enable the BootP/DHCP relay agent. | Enable the DHCP relay agent: set forwarding-options helpers bootp relay agent-option |
Enable VPN encryption to allow client requests to pass through the VPN tunnel. | Select the VPN encryption check box. | Enable VPN encryption to allow client requests to pass through VPN tunnel: set forwarding-options helpers bootp vpn |
Define the IP time-to-live value to be set in responses to client—for example, 20. The range is 1—255. | In the Client response TTL box, type20. | Set the IP time-to-live value to be set in responses to client to 20: set forwarding-options helpers bootp client-response-ttl 20 |
Define the maximum number of hops allowed per packet—for example, 10. The range is 4—16. | In the Maximum hop count box, type 10. | Set the maximum number of hops allowed per packet to 10: set forwarding-options helpers bootp maximum-hop-count 10 |
Define the minimum number of seconds before requests are forwarded—for example, 300. The range is 0—30000 seconds. | In the Minimum wait time box, type 300. | Set the minimum number of seconds before requests are forwarded to 300: set forwarding-options helpers bootp minimum-wait-time seconds 300 |
Define the text description of the server. The value is a string. | In the Description box, type the description of the server. | Set the description of the server: set forwarding-options helpers bootp description text |
Adding a new server | ||
Define a valid server name or address to the server to forward. The value is an IPv4 address. |
| Set the server name: set forwarding-options helpers bootp server |
Define the routing instance. The value is a nonreserved text string of 128 characters or less. |
| Set the routing instance: set forwarding-options helpers bootp server routing instance |
Adding a new interface | ||
Define the incoming BootP/DHCP request forwarding interface—for example, ge-0/0/0. |
| Set the incoming BootP/DHCP request forwarding interface to ge-0/0/0: set forwarding-options helpers bootp interface ge-0/0/0 |
Enable broadcast option, if the layer 2 interface is unknown. | Select the Broadcast check box, if the layer 2 interface in unknown. | Set the broadcast option: set forwarding-options helpers bootp interface ge-0/0/0 broadcast |
Define the IP time-to-live value to be set in responses to client—for example, 30. The range is 1—255. | In the Client response TTL box, type30. | Set the IP time-to-live value to be set in responses to client to 30: set forwarding-options helpers bootp interface ge-0/0/0 client-response-ttl 30 |
Define the text description of the server. The value is a string. | In the Description box, type the description of the server. | Set the description of the server: set forwarding-options helpers bootp interface ge-0/0/0 description text |
Define Dhcp option 82, to configure DHCP option 82. | Select the Dhcp option 82 check box. | Set the Dhcp option 82: set forwarding-options helpers bootp interface ge-0/0/0 dhcp option 82 |
Define the maximum number of hops allowed per packet—for example, 20. The range is 4—16. | In the Maximum hop count box, type 20. | Set the maximum number of hops allowed per packet to 20: set forwarding-options helpers bootp interface ge-0/0/0 maximum-hop-count 20 |
Define the minimum number of seconds before requests are forwarded—for example, 400. The range is 0—30000 seconds. | In the Minimum wait time box, type 400. | Set the minimum number of seconds before requests are forwarded to 400: set forwarding-options helpers bootp interface ge-0/0/0 minimum-wait-time seconds 400 |
Enable No listen option. | Select the No listen check box. | Set the No listen option: set forwarding-options helpers bootp interface ge-0/0/0 no-listen |
Enable VPN encryption to allow client requests to pass through the VPN tunnel. | Select the VPN encryption check box. | Enable VPN encryption to allow client requests to pass through VPN tunnel: set forwarding-options helpers bootp interface ge-0/0/0 vpn |
Commit changes. | Click OK until you return to the Configuration page. | |
Hide Navigation Pane
Show Navigation Pane
Download
SHA1