How to use DHCP with manual address in Windows?

1

In OS X there's an option for use DHCP with manual address: is there any way to do that (or something similar, with any program) in Windows?

image:

enter image description here

Here's my problem:

At my school there's a wifi with proxy, I can connect my iPhone, my Mac, phones running Android, but I can't connect computers using Windows to it, I thinks it's cause I couldn't find an option like that on Windows, does anybody knows of something else I could do?

If there's no way to do that on windows, any Linux solution?

EDIT: Turned out that after trying the answers below a lot of times, I accidentally put the wrong subnet mask (DHCP gives 10.244.49.220 and it was inserted as 10.255.49.220) and it connected. Black magic.

GBF_Gabriel

Posted 2013-08-21T01:50:44.823

Reputation: 113

1No the option does not exist – Ramhound – 2013-08-21T01:53:18.267

Just for clarification... DHCP gives you an ip, but you want or need (which is it?) to make it static is that right? what's the reason for needing a non-dynamic ip? – monsto – 2013-08-21T04:17:29.723

@monsto the Wifi at my school is protected under proxies and the IP are assigned for each student, but turned out only my Mac was connecting with that configuration, and the windows computers wouldn't connect even if they copy the DHCP subnet mask gateway etc. – GBF_Gabriel – 2013-08-24T00:34:32.547

Answers

0

Question 1:

Windows does not natively have an option to take a DHCP lease and override the IP address

Question 2:

You can accept a DHCP lease then reconfigure your network based upon the information provided in the DHCP lease - more information after break

Question 3:

Leaving open to others to answer but linux is very open-ended it would be better to ask if there are any linux distros that support this functionality


Assumptions:

OP has basic understanding of CLI and windows command prompt

Tools needed

Windows command prompt


Okay we're going to start up Command prompt and start typing commands and noting down some basic information from the output

ipconfig /all

From the output you need to identify which adapter you want to be working with eg: Local Area Connection going forward I will refer to this selection as foo

Next commands:

netsh interface ip set address name="foo" dhcp

ipconfig /release

ipconfig /renew

ipconfig /all

This will set your foo interface to release any current leases ten request and accept a DHCP then lastly display the config from that DHCP lease

From here you will need to make note of your foo interfaces DNS Servers, Default Gateway and Subnet Mask

Going forward I will refer to these as follows

  • The static IP address you want = x
  • Subnet Mask = y
  • Default Gateway = z
  • DNS Server 1 = a
  • DNS Server 2 = b

From here we have all the information we need so we can finish this in 3 more commands

netsh interface ip set address name="foo" static x y z

netsh interface ip set dns "foo" static a

netsh interface ip add dns "foo" b INDEX=2

If you would like a better understanding of how these commands work you can read up on the technet KB items

50-3

Posted 2013-08-21T01:50:44.823

Reputation: 3 779

Big thanks for the answer, I'll try it out tomorrow. – GBF_Gabriel – 2013-08-21T03:50:05.080

It worked and I made a .bat for changing proxy between various wifi, thanks for the command lines. – GBF_Gabriel – 2013-08-24T00:29:53.303

1

Short answer: If it's something you need to get things done, then talk to campus network support. If that's the case, they may already have a process for you to follow

If it's NOT for classwork then on windows 7 you can try the following. But read the whole thing first, and understand the caveats:

  1. click start > run
  2. type cmd, Enter
  3. type ipconfig, Enter
  4. you may have to read through the output, but you can find the adapter in use and an entry for "IPv4 Address". Yours will likely be 192.168.x.x (not a guarantee). mine says 192.168.1.120. so we'll use that for the example going forward. Leave this window open.
  5. go to Start > Control Panel > Network and Sharing Center
  6. in the "View your active networks" section, right side, it shows your connection. Click that.
  7. click Properties
  8. highlight (single click) "Internet Protocol Version 4 (TCP/IPv4)"
  9. click Properties

In this window, you can select "Use the following IP address:" and set the "IP address" field to match the IPv4 Address shown in the ipconfig output. You must also set the Subnet mask and Default gateway to match those entries from the ipconfig output.

Caveats...

You will likely not have any problems with this, but I wouldn't trust it. It doesn't affect your dynamic ip address leases. So, depending on the config of the network you're on, it may force release of your ip at anytime, take your ip lease from you and give it to someone else. In that case, it will most likely prefer the person with the full dynamic config (because their station accepted it outright) and leave you with no network connection... forcing you to call support and give them a chance to chastise you for TRYING TO HACK OUR SYSTEM!!1 or some nonsuch.

Finally

50-3 said basically the same thing, but using the command line while I directed you through the graphical user interface. The problem is much the same: your system is dependent upon how the network treats ip leases. A lot of networks don't bother them, but colleges can be pretty anal about people doing "illicit things" over their networks, and employ all kinds of non-standard practice to thwart them.

On a technical level, though, there's nothing in either of our posts that could floob your machine beyond use. The worst thing that could happen is that you randomly lose internet at the worst time and have to call someone.

monsto

Posted 2013-08-21T01:50:44.823

Reputation: 850

prefer the person with the full dynamic config (because their station accepted it outright) Actually it will cause a network conflict as two people on the network will have the same address. – 50-3 – 2013-08-23T03:25:05.297

Thank you for your answer, as this do the same thing as the other answer I choose the other one as best because the command line helped me. But both are correct. – GBF_Gabriel – 2013-08-24T00:31:20.047