Home‎ > ‎Juniper‎ > ‎Basic JunOS Configs‎ > ‎

dhcp






DHCP Server: 

Define the DHCP service
! define the range (in this case between 128-159)
set system services dhcp pool 10.120.35.0/24 address-range low  10.120.35.128
set system services dhcp pool 10.120.35.0/24 address-range high 10.120.35.159
! list dns info
set system services dhcp pool 10.120.35.0/24 domain-name cmed.us
set system services dhcp pool 10.120.35.0/24 name-server 8.8.4.4
set system services dhcp pool 10.120.35.0/24 name-server 8.8.8.8
! def gateway and lease
set system services dhcp pool 10.120.35.0/24 router 10.120.35.1
set system services dhcp pool 10.120.35.0/24 default-lease-time 3600

then allow dhcp over the zone: 
set security zones  security-zone untrust interfaces fe-0/0/0.0 host-inbound-traffic systems-services dhcp

then make sure that interface fe-0/0/0.0 has the IP range 10.120.35.0/24

DHCP Relay: 

If you have a central dhcp server, and you need all dhcp requests forwarded to it, then setup a dhcp helper.  
set forwarding-options helpers bootp description "Global DHCP relay service"
set forwarding-options helpers bootp server 10.120.34.30
set forwarding-options helpers bootp maximum-hop-count 5
set forwarding-options helpers bootp interface fe-0/0/0.0


Troubleshooting: 

for dhcp relay: 
user@host> show system services dhcp relay—statistics
  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

for dhcp services: (see what the configuration does)
user@host> show system services dhcp global
Global settings:
    	BOOTP lease length     	   infinite
  	DHCP lease times:
    	Default lease time         1 day
    	Minimum lease time         1 minute
    	Maximum lease time         infinite

	DHCP options:
    	Name: domain-name, Value: englab.juniper.net
    	Name: name-server, Value: [ 192.168.5.68, 172.17.28.101, 172.17.28.100 ]

view all the dhcp leases 
user@host> show system services dhcp binding
IP Address   Hardware Address   Type          Lease expires at
30.1.1.20  00:12:1e:a9:7b:81  dynamic       2007-05-11 11:14:43 PDT



References: 



Comments