Need to change IP address easily, no DHCP available.

Mr N8

Diamond Member
Dec 3, 2001
8,793
0
76
I've got to set up a laptop user to be able to use his machine at 4 branch offices, as well as his desk. Idealy, I would like him to be able to click on an icon for the branch he is at, and that would set his IP for the specific location. We don't have DHCP set up, because our software needs a static IP to work properly.

For instance:

Users desk: 192.168.1.100
Branch 1: 192.168.5.100
Branch 2: 192.168.6.100
Branch 3: 192.168.3.100
etc...

Is there any way to make this IP change easy on the user? He's not very computer savvy, so the easiest solution would be the best solution, in this case.

 

Kelemvor

Lifer
May 23, 2002
16,928
8
81
Could just make some registry batch files if you wanted to.

Put in one of the numbers, then search the registry for all the places that number show sup and export them out into a file that can put them back in.
 

ktwebb

Platinum Member
Nov 20, 1999
2,488
1
0
yep, just go to a command line and type netsh /?

It would be something like

C:\netsh interface ip set address name="Local Area Connection: source=static
C:\netsh interface ip set address local static 192.168.1.100 255.255.255.0 192.168.1.1
last number is the gateway. I am no expert at netsh so someone correct my syntax if I am off there but you get the idea.
 

JackMDS

Elite Member
Super Moderator
Oct 25, 1999
29,552
429
126
Using the Command Prompt, the following command would configure an IP setting by the name - Local Area Connection - with the static IP address 192.168.1.2, the subnet mask of 255.255.255.0, and a default gateway of 192.168.1.1:

netsh interface ip set address name="Local Area Connection" static 192.168.1.2 255.255.255.0 192.168.1.1

Command has to be one line (change the numbers to fit your IPs band).

:sun:

Other useful Command line using Netsh.exe

Obtain an IP address from a DHCP server:

netsh interface ip set address "Local Area Connection" dhcp

Configure DNS.

netsh interface ip set dns "Local Area Connection" static 192.168.1.250

Configure WINS.

netsh interface ip set wins "Local Area Connection" static 192.168.1.250

Configure an NIC to dynamically obtain its DNS settings:

netsh interface ip set dns "Local Area Connection" dhcp

You can create a nice config system by putting according to your needs few commands into batch files.

Copy and paste as long as it is available.

:sun:
 

Mr N8

Diamond Member
Dec 3, 2001
8,793
0
76
Got it...you need to use 2 commands to set the IP and the gateway:

netsh interface ip set address "Local Area Connection" static <ipaddr> <subnetmask>
netsh interface ip set address "Local Area Connection" gateway = <gateway> gwmetric = <metric>