server can dynamically allocate IP addresses and other configuration parameters,
minimizing the overhead that is required to add clients to the network.
A DHCP configuration consists of two components—an optional reconfiguration of default
settings on DHCP clients and the configuration of a DHCP server. This topic covers
configuration of the switch as a local DHCP server using DHCP for IPv4 (DHCPv4). For
information about DHCPv6 local server, see “DHCPv6 Local Server Overview” on page 40.
This topic describes the following task:
1.
Configuring the Switch as a Local DHCP Server on page 15
Configuring the Switch as a Local DHCP Server
To configure a switch as a local DHCP server, you must configure a DHCP address pool
and indicate IP addresses for the pool. The switch, operating as the DHCP server,
dynamically distributes the IP addresses from this pool. The switch can dynamically
assign additional configuration parameters, such as default gateway, to provide the client
with information about the network.
Multiple address pools can be configured for a DHCP server. DHCP maintains the state
information about all configured pools. Clients are assigned addresses from pools with
subnets that match the interface on which the DHCPDISCOVER packet sent by the client
is received on the server. When more than one pool exists on the same interface, addresses
are assigned on a rotating basis from all available pools.
You must ensure that you do not assign addresses that are already in use in the network
to the address pools. The DHCP server does not check whether the addresses are already
in use in the network before it assigns them to clients.
1. Configure a Layer 3 interface with an IP address on which the DHCP server will be
reachable:
[edit]
user@switch# set interfaces interface-name unit unit-number family family address
address/prefix-length
user@switch# set vlans vlan-name vlan-id vlan-id
user@switch# set vlans vlan-name l3-interface irb-name
user@switch# set interfaces irb-name l3-interface irb-name family family address
address/prefix-length
For example:
[edit]
user@switch# set interfaces ge-0/0/1 unit 0 family inet address 192.0.2.1/24
user@switch# set vlans server vlan-id 301
user@switch# set vlans server l3-interface irb.301
user@switch# set interfaces irb.301 family inet address 192.0.2.2/24
2. Configure the DHCP server for the Layer 3 interface:
[edit]
user@switch# set system services dhcp-local-server group-name interface
interface-name
15Copyright © 2017, Juniper Networks, Inc.
Chapter 1: DHCP Services