SRX

last person joined: 10 hours ago 

Ask questions and share experiences about the SRX Series, vSRX, and cSRX.
Expand all | Collapse all

DHCP not working properly on juniper

  • 1.  DHCP not working properly on juniper

    Posted 05-26-2016 17:15

    DHCP is not working very well for my Juniper SRX or maybe someone needs to point me in the right direction

     

    dhcp {
                pool 10.10.0.0/16 {
                    address-range low 10.10.1.1 high 10.10.255.254;
                    maximum-lease-time 604800;
                    router {
                        10.10.0.1;
                    }
                }
    }

    but the problem is i have a device previosuly using dhcp get an address 10.10.1.24 and then now i want to set that ip as static ip for another device, so i shut off the device currently using that address and then set it as static ip for another device. 

     

    The problem is when i start back the other device that first had that ip address via dhcp, it uses that same ip again because of the lease time i guess, but shouldn't dhcp server re-assign another ip since the first ip is now being used statically?

     

    How can i have dhcp server behave like a dhcp server and re-assign ip addresses if they are being used for whatever reason. It need s to re-assign and that is the problem juniper srx dhcp can't do.

     

    PLEASE HELP!

     

    Thanks!!!



  • 2.  RE: DHCP not working properly on juniper

    Posted 05-27-2016 00:25

    Hello,

     

     

    Please share the output of the command "show system services dhcp binding" when the static binding is configured and the lease for the previous DHCP allocation has not timed out but the clinet is off.

     

    Also share the same output from the time when the client is then turned on.

     

    Thanks,
    Pulkit Bhandari

     

    Please mark my response as Solution Accepted if it Helps, Kudos are Appreciated too. Smiley Happy

     

     



  • 3.  RE: DHCP not working properly on juniper

    Posted 05-27-2016 09:08

    Here is the output

     

    root@srxrouter% cli
    root@srxrouter> show system services dhcp binding
    IP address       Hardware address   Type     Lease expires at
    10.10.1.8       00:16:3e:37:60:d6  dynamic  2016-05-27 20:52:05 EDT
    10.10.1.7       00:16:3e:65:65:8a  dynamic  2016-05-27 20:52:05 EDT
    10.10.1.5       00:16:3e:80:df:6c  dynamic  2016-05-27 20:52:05 EDT
    10.10.1.9       00:16:3e:8e:3a:8a  dynamic  2016-05-27 20:52:07 EDT
    10.10.1.4       0a:11:ed:5d:54:54  dynamic  2016-05-28 05:51:48 EDT
    10.10.1.10      3e:74:b0:1e:ad:31  dynamic  2016-05-28 11:59:12 EDT
    10.10.1.6       72:5f:73:14:76:c7  dynamic  2016-05-28 07:57:05 EDT
    10.10.1.2       9e:4c:87:78:e0:44  dynamic  2016-05-28 11:57:39 EDT
    10.10.1.12      de:a2:18:27:f4:a2  dynamic  2016-05-28 11:05:11 EDT
    10.10.1.3       f2:c8:b2:f8:c9:c5  dynamic  2016-05-28 11:56:30 EDT
    10.10.1.1       f6:2e:80:ca:67:44  dynamic  2016-05-27 19:59:06 EDT
    10.10.1.13      f6:2e:80:ca:67:44  dynamic  2016-05-28 05:07:40 EDT

    So the 10.10.1.1 is assigned statically to another device now but it still shows as dynamic. Is that how it shows even if its dynamic?

     

    Also the other device that owned that IP before is turned off, as soon as i turn it on, it gets back the 10.10.1.1, so how do i have DHCP assign another device since 10.10.1.1 is assigned and used already?

     

    Thanks



  • 4.  RE: DHCP not working properly on juniper

     
    Posted 05-27-2016 15:43

    Your problem stems from a false expectation of what a DHCP server should do. As jsree noted you should not assign a static address to a device if you've already configured a dhcp server to use it in a dynamic range. Alternatively configure the dhcp server to give out that address as a static assignment based on the MAC address.



  • 5.  RE: DHCP not working properly on juniper

    Posted 05-28-2016 10:21

    So a DHCP server does not check if an ip address is in use and not re-assign that ip but assign a different ip?

    Isn't that how dhcp works?



  • 6.  RE: DHCP not working properly on juniper
    Best Answer

    Posted 05-29-2016 05:37

    Hello,

     

     

    No, The DHCP does check if an IP address is in use or not and assign a different IP address if one is in use.

     

    But in your case the IP address was assigned dynamically to one machine with some lease. Then you turned off that machine but the lease is still active. Also you configured a static Binding for the same IP address but that binding is not seen in the DHCP bindings on the SRX.

     

    The static binding is not seen becasue a lease (dynamic) already exists for that IP address on SRX and since it has not expired and neither manually cleared, the static binding which will have lease timeout of never will not become active. Hence when you turn on the device again it again gets the same IP address which you have binded statically to some other device.

     

    Also adding to Jsree's comments i would like to say that using an IP address outside the address assignment pool for static bindings would be ideal solution in your case as the above explained lease issue will not at all happen then. But if you want to use an IP address in the same range then you can exclude that IP address from the address assignment pool using the below command:-

     

    set system services dhcp pool 10.10.0.0/16 exclude-address 10.10.1.1

     

    Please update if the above explanation helps.

     

     

    Thanks,
    Pulkit Bhandari

     

    Please mark my response as Solution Accepted if it Helps, Kudos are Appreciated too. Smiley Happy



  • 7.  RE: DHCP not working properly on juniper

    Posted 05-29-2016 09:14

    How do i clear the dhcp and lets it start all over? I don't want to exclude, i just want it to respect my static assignment

     

    So what command to clear?

     

    Thanks



  • 8.  RE: DHCP not working properly on juniper

     
    Posted 05-29-2016 09:52


  • 9.  RE: DHCP not working properly on juniper

    Posted 05-29-2016 19:19

    getting error that dhcp subsystem not running

     

    clear dhcp server binding all
    warning: dhcp-service subsystem not running - not needed by configuration.
    
    restart dhcp-service
    warning: dhcp-service subsystem not running - not needed by configuration.

    and

    show system processes | match dhcp
     1503  ??  S      2:17.65 /usr/sbin/dhcpd -N


  • 10.  RE: DHCP not working properly on juniper

    Posted 05-31-2016 00:43

    Hello,

     

     

    Please try using the command "clear system services dhcp binding <ip_address>" andd see if it works for you.

     

    Thanks,
    Pulkit Bhandari

     

    Please mark my response as Solution Accepted if it Helps, Kudos are Appreciated too. Smiley Happy

     



  • 11.  RE: DHCP not working properly on juniper

     
    Posted 05-27-2016 04:11

    Hi

     

    Please try to do the below steps,

     

     

    • Previously expired IP address is still bound to the MAC address of the client

      To ensure that the client is receiving the static address, as per it's MAC, run the following command to verify:

      root> show system services dhcp binding | match <ip address>


      If the above output shows a previously expired IP address that is bound to the MAC address, then use the following command to clear it manually:

      root> clear system services dhcp binding <dynamic address which is associated with the configured MAC>

    Please update me the result.As a correct way of deploying dhcp,It is adviced to put dhcp Ip and staticaly assigned IP in different range.