Page 1 of 1

Setting static IP based on current dhcp for lan

Posted: 16 Feb 2016 21:48
by julesverne
Hi all, this seems to be something I have to do a lot, manually. Basically I have a cmd window open, I run ipconfig, and then go into the network configuration UI (win 7) to set it as static IP. The process is an annoying amount of steps. Before I go down the rabbit hole and reinvent the wheel..anyone figured this out already via bat?

Re: Setting static IP based on current dhcp for lan

Posted: 17 Feb 2016 00:40
by foxidrive
Does this give you one or two solutions?

https://www.google.com.au/search?hl=en& ... mmand+line

Re: Setting static IP based on current dhcp for lan

Posted: 17 Feb 2016 19:27
by Squashman
You do not want to set a static ip address that is part of a DHCP servers address pool.

Re: Setting static IP based on current dhcp for lan

Posted: 17 Feb 2016 20:13
by julesverne
Squashman wrote:You do not want to set a static ip address that is part of a DHCP servers address pool.

why? Is it because the server may assign that address to another computer on the network and cause conflicts?

Re: Setting static IP based on current dhcp for lan

Posted: 17 Feb 2016 20:47
by Squashman
julesverne wrote:
Squashman wrote:You do not want to set a static ip address that is part of a DHCP servers address pool.

why? Is it because the server may assign that address to another computer on the network and cause conflicts?

That is the whole point of a DHCP server. It knows what addresses it has allocated. It does not know you set a static IP address within the range of IP address of the pool.

Re: Setting static IP based on current dhcp for lan

Posted: 18 Feb 2016 12:15
by julesverne
Squashman wrote:That is the whole point of a DHCP server. It knows what addresses it has allocated. It does not know you set a static IP address within the range of IP address of the pool.


Thank you @Squashman as ignorant as it sounds.. I had no idea. I hadn't really thought about it but I guess I probably figured the dhcp server would just detect that an IP was in use and pick another. I've been doing it for a long time and never had issues. I wasn't aware that it isn't good practice. Changing my habits now. Thanks again.