Juniper SRX 300 with a DHCP server
First – add the following line:
set system services dhcp-local-server requested-ip-interface-match
Create a name for the pool and set the network. I named this pool CAMERAPOOL
set access address-assignment pool CAMERAPOOL family inet network 10.9.5.0/24
Set the range of addresses you are going to hand out via dhcp
set access address-assignment pool CAMERAPOOL family inet range CAMERA-RANGE low 10.9.5.10
set access address-assignment pool CAMERAPOOL family inet range CAMERA-RANGE high 10.9.5.100
Set the domain name
set access address-assignment pool CAMERAPOOL family inet dhcp-attributes domain-name mydomain.com
Hand out some name servers
set access address-assignment pool CAMERAPOOL family inet dhcp-attributes name-server 94.140.14.14
set access address-assignment pool CAMERAPOOL family inet dhcp-attributes name-server 94.140.14.15
Set the default gateway. This is usually the same IP address on the interface of the SRX
set access address-assignment pool CAMERAPOOL family inet dhcp-attributes router 10.9.5.1
set up a couple of reservations
set access address-assignment pool CAMERAPOOL family inet host FRONTDOORCAM hardware-address ec:71:db:99:59:17
set access address-assignment pool CAMERAPOOL family inet host FRONTDOORCAM ip-address 10.9.5.12
set access address-assignment pool CAMERAPOOL family inet host UNDERDECKCAM hardware-address ec:71:db:c4:42:ce
set access address-assignment pool CAMERAPOOL family inet host UNDERDECKCAM ip-address 10.9.5.11
Now add it to the system services
set system services dhcp-local-server group CAMERA interface ge-0/0/0
Where: CAMERA is just a name you can assign and the interface is the interface where you want to offer up dhcp supplied addresses
Add additional “set system services dhcp-local-server group” lines for each network you want to provide dhcp services for
Issues:
A device moved from one network connected to the SRX to another network connected to the SRX continues to be issued the same ip address for the first network.
Resolution: Make sure the following line is in the configuration
set system services dhcp-local-server requested-ip-interface-match
Tested on version 15.1X49-D211
HT: https://majornetwork.net/2014/11/juniper-srx-old-and-new-dhcp-with-problems/