2

Running Windows, whenever I try this:

ipconfig /release
net stop dhcp
net start dhcp
ipconfig /renew

I get the old IP address re-assigned except on the first attempt. On the first attempt it gave a new IP. But thereafter it is giving me back my old IP.

4
  • 2
    Hey, maybe you're getting handed the first available ip-address every time you ask? Are you on a home or work network? We need more info!
    – Bungicasse
    Commented Nov 29, 2016 at 13:13
  • 3
    Some DHCP servers have an option to reissue the same IP to the same client if able. The DHCP server might be giving you the same address every time. Check the configuration of the DHCP server.
    – mtak
    Commented Nov 29, 2016 at 13:40
  • look as this: How to change MAC address with batch file on Windows 7 Commented Dec 3, 2016 at 18:17
  • I am on a home network. and don't have any access to control DHCP server. @Bungicasse Commented Dec 8, 2016 at 6:26

4 Answers 4

4

When you delete your new IP address lease with ipconfig /release it's up to the DHCP server to decide what IP address you get when you request a new lease. The DHCP server will assign the "next available" IP address, which could easily be the address you just released.

If you have control of the DHCP server and don't want the same IP address you currently have, your options include:

  1. Exclude the unwanted IP address from the pool of available DHCP leases so that the DHCP server won't assign the address.
  2. Create a DHCP reservation assigning the address you want to the MAC address of your network adapter.

If you don't have control of the DHCP server, your options then become:

  1. Avoid DHCP altogether and assign a static IP address to your network adapter.
  2. Try to get another computer on the network to get a lease for the unwanted IP address so the DHCP server cannot assign that to your computer.
3
  • dhcp servers can cache leases, if they set to do this, then even he connect another computer to network, he get new ip on new host and old unwonted ip on 1st. Commented Dec 3, 2016 at 20:02
  • @AdamSilenko Some DHCP server implementations behave this way, but that doesn't take this option off the table for those that do not cache leases. Good point to keep in mind though. Commented Dec 3, 2016 at 20:06
  • When i reset my Mifi, run CCleaner ,restart my PC and then reconnect, I often get my problem solved.But i don't want it this way. I am just trying to achieve this using only "one PC" without restarting it. And yes,I liked the approach of your answer. Commented Dec 8, 2016 at 6:34
0

That is pretty much the way DHCP Servers work. It will always give you your last issued IP if it is available. Other than MAC spoofing you can turn your computer off, turn on some other device that needs an IP address so it will be issued "your old IP". Then turn your computer back on and it will issue you a new one. There was no mention of what you were trying to accomplish or why you needed a new IP but an alternative would be to static IP yourself and change when needed.

0

Basically, you may not be able to force this.

The DHCP server is in control of handing out DHCP addresses. That server decides which IP you get; not something you do on your local computer.


Having said that, you may be able to game the DHCP server, knowing that most work as follows:

  • They have a limited range of IPs to hand out. (e.g. 1.2.3.100 till 1.2.3.200).
  • They remember which IP already has been given out and until which time that lease is valid.
  • When handing out a new IP they often use a not-yet used IP, if available. If they run out they will NACK the DHCP request. If they run out of unused IPs but have older IP which are no longer handled out (leae expired) they will ahnd those out.
  • Most of the time they will check which IP you had previously when they receive a DHCP req (either on their own or as part of the DHCP req package). They are allowed they give you the same IP.

The last is what is helping you (clippy style helping).

You get an IP (say 1.2.3.100, which is valid for X hours. (Say 24h).

After 12 hours you say "Hey, I want to release this IP"
This work.
You then ask for an IP again ("Hey, I am AA:BB:CC:DD:EE:FF which last had IP 1.2.3.100. Can I please have an IP again?"). This time you want another IP, but the DHCP server is helpfully giving you 1.2.3.100 again.

Two option are here:

  1. Do not clain the "I had last 1.2.3.100". Depends on your DHCP client (IIRC windows did not do that in the past, though it was allowed. Unix client correctly handled this part).
  2. Claim to be someone else. (e.g. change the MAC address).

The correct way however is to ask "Why do I want a different IP" and solve that. E.g. by talking with your network admin and getting a reserved IP, or setting a static IP (and you admin marking that IP as in used so she never gives that out again).

0

If you need new ip when dhcp have lease or reservation for your mac address, then you need change your mac (if you don't have access to DHCP server).
When you connect host to network with DHCP server, the you get IP:
1. if DHCP server have reservation for mac then you get always the same IP
2. if DHCP server have lease cached for your mac then you get old IP
3. else then you get first available IP

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .