SRX DHCP Configuration

DHCP configuration is very straight forward in junos. However if you are like me, you can even forget that gateway address must be within the advertised pool. Here is a simple config

set system services dhcp default-lease-time infinite
set system services dhcp domain-name rtoodtoo.net
set system services dhcp name-server 8.8.8.8
set system services dhcp name-server 8.8.4.4
set system services dhcp router 192.168.100.1
set system services dhcp pool 192.168.100.0/24 address-range low 192.168.100.33
set system services dhcp pool 192.168.100.0/24 address-range high 192.168.100.62

Once this config is in place, make sure you allow DHCP service on gateway interface e.g

set security zones security-zone trust interfaces fe-0/0/0.0 host-inbound-traffic system-services dhcp

Note that you are able to allow dhcp service specifically in an interface not in a zone. For example if you type “set security zones security-zone trust host-inbound-traffic system-services” you will see that there is no option for dhcp.

After committing, you can see the bindings via;

root@srx100-1> show system services dhcp binding
IP address       Hardware address   Type     Lease expires at
192.168.100.33   00:16:e6:32:ab:bd  dynamic  2012-10-10 00:28:43 CEST

Other commands for troubleshooting;

root@srx100-1> show system services dhcp ?
Possible completions:
  binding              Show DHCP client binding information
  client               Show DHCP client information
  conflict             Show DHCP address conflict
  global               Show DHCP global scope information
  pool                 Show DHCP address pool information
  relay-statistics     Show DHCP relay statistics information
  statistics           Show DHCP statistics
Tags:

About: rtoodtoo

Worked for more than 10 years as a Network/Support Engineer and also interested in Python, Linux, Security and SD-WAN, currently living in the Netherlands and works as a Network Support Engineer. // JNCIE-SEC #223 / RHCE / PCNSE


You have a feedback?

This site uses Akismet to reduce spam. Learn how your comment data is processed.