Network adapter address presets?
January 22, 2013 8:44 AM   Subscribe

I am looking for something to help me quickly and easily change the IP address(es) I use on my laptop's network adapter.

The operating system is Windows 7. Changing it is not an option.

My day job is in HVAC and industrial/commercial security. I regularly go to sites and wire myself into their network to access their equipment. Some sites need me to be set to automatically get an IP address, others need me to set a single address, and other still require me to have three, four, five or six IP addresses on my network adapter. Every time I go to a site, I manually change the IP address on my network adapter to suit the site. I keep track of the IPs for each site on my blackberry. Currently I have over forty sites that I need to change my IP information to access, and it is getting tiresome.

What I want is a way to have presets or saved configs for my network adapter so I can go in and click "YOUTH PRISON" or "CANCER CLINIC" or "FEDERAL OFFICE BUILDING" and have my network adapter load up the correct IPs. Is there such a thing? Is there something in Windows 7 that does this that I don't know about?
posted by Sternmeyer to Computers & Internet (5 answers total) 2 users marked this as a favorite
 
Network Switcher looks like it should do what you need; I've never used it though so can't vouch for it personally.
posted by reptile at 8:46 AM on January 22, 2013 [1 favorite]


This link gives a command-line syntax for setting the IP information. You can create 3 batch files, each of which contain the following for their respective connection settings

@ECHO OFF
netsh interface ipv4 set address “local area connection” static 192.168.1.2 255.255.255.0 192.168.1.254


And that's it. (I copied his first example.)

Put these batch files (or, to be on the safe side, shortcuts to these batchfiles) on the desktop, label them "CANCER CLINIC" "YOUTH PRISON" &c. and whenever you arrive at the new location, doubleclick the link.

Be sure to set the files/shortcuts to run as administrator, as mentioned in the article.

It's also possible to meddle with services; for example if you want SNMP to be off when you're at the prison or the clinic, but on when you're at the office building. Also you could, say, disable the Wi-Fi connection at the Prison, but enable it elsewhere. Anything that you can do from the command line can probably be automated.
posted by Sunburnt at 8:57 AM on January 22, 2013 [4 favorites]


I would use Sunburnt's solution. That seems like the easiest way to manage this. I doubt a general purpose app will work as quickly or be any easier to set up.

You can either just create files for each site ad hoc, or create a generic template and use variables to make reconfiguration easier. The template could look something like this:

rem Config for Building X

IP-ADDRESS="192.168.1.2"
SUBNET-MASK="255.255.255.0"
GATEWAY="192.168.1.254"
DHCP="yes or no"

[code to erase existing configuration]

if %DHCP% = "yes" then
  netsh interface ipv4 set address name=”local area connection” source=dhcp
else
  netsh interface ipv4 set address “local area connection” static %IP-ADDRESS% %SUBNET-MASK% %GATEWAY%

(Obviously, my syntax probably isn't right and is also just copied from the link.)

It might take some time to get it figured out and set up, but the result should be that you have one-click configuration for each site.

I'm curious about the usage case of having to have multiple IP addresses at one time? Or did you mean that a site might require any one of 6 different addresses depending on what you happen to be doing at that site?
posted by gjc at 9:20 AM on January 22, 2013


Response by poster: Thanks for the suggestions. I'm going to see about the Network switcher app, but my boss is not crazy on it because he doesn't trust software from "the Internet". However as long as our lax IT department OKs it, I will get to try it out.

Re: multiple IP addresses. When I go to a site for the first time I get the required network setup info from the relevant folks. Sometimes they tell me I need to add extra addresses to be able to "see" all the equipment.

Here's an example. One place I visit regularly has hundreds of cameras. Like six or seven hundred. They have IP addresses that span several, uh, subnets I think is the word? Using different numbers, the cameras start at 192.168.1.10 and run right up to 192.168.1.200, then the next bunch of cameras start at 192.168.2.10 and run up to 192.168.2.200, and so on until the last camera is at 192.168.4.100.

So when I go there I set my adapter to be addressed to 192.168.1.201 and add the extra addresses 192.168.2.201/192.168.3.201/192.168.4.201 in the Advanced Properties of TCP/IPv4 in the properties of my network adapter. If I don't do this, I can only access the configuration of the cameras on the subnet(?) that my adapter has in its Properties window. Sometimes that's OK like if I am only working on camera stuff on one camera or a single area but generally I have multiple tasks that span multiple cameras.

Another similar site is a hospital where the cameras are on one subnet(?) and the access control equipment is on another subnet(?). When I am there I need two IP addresses because the cameras are integrated with the access control equipment so any changes on one need to be tested on the other.

As you can likely tell I don't understand networks much. They are not really a part of my job other than that I need to get on them to do my actual job of programming building automation systems and the like.
posted by Sternmeyer at 1:01 PM on January 22, 2013


In the case of the place with the hundreds of cameras, you may be able to get away with a broader subnet mask.

Here's a little TCP/IP Subnetting 101:

Subnet mask is a filter (think of a mask in image processing) that tells your computer what nodes (computers and any other networked devices, including cameras) are to be considered local, i.e. in the local network, compared to those that are remote, and therefore should be accessed via the gateway. The gateway is your router/bridge/modem that goes to the outside network.

If all the cameras are in 192.168.???.???, you can probably get away with changing your subnet mask to 255.255.0.0 at that location.

As I said, subnet mask is a filter. 255.255.000.000 is actually this, in binary:
11111111.11111111.00000000.00000000 In "slash notation" this mask is represented as "/16," because there are 16 1s. The more common 255.255.255.0 is /24-- e.g. your IP address with mask could be 192.168.???.???/16

Even when a mask ends with a strange number like 252, it still corresponds, in binary, to a bunch of 1s followed by zeros. (ones will never follow a zero in a legal subnet mask). For two IP addresses to be considered local, all the bits in the "1s" region of the mask must be a match. The more 1s and fewer 0s, the more narrow the mask, and the fewer (possible) IP addresses that your node will consider "local."

Say your IP address is 192.168.1.5. That's
11000000.10101000.00000001.00000101 Now the mask /16 is
11111111.11111111.00000000.00000000 meaning
[<>][<>] So any 192.168.? address will match the first 16 bits, therefore any number in the 3rd and 4th group (group = "octet" = 8 bits) is allowed.

If I'm not mis-remembering, and your network is configured the way I'd configure it, when you're at the place with cameras, and your subnet mask is wide enough (/16) to include all nodes in the 192.168.*.* subnets as local, you won't need to do those additional settings.

Why not set the subnet mask as 128.0.0.0 = 10000000.00000000.00000000.00000000? Well, sometimes you don't want computers to be able to see every other computer. It's just bad practice.
posted by Sunburnt at 3:39 PM on January 23, 2013


« Older MacBook Pro i5 vs i7 -- Prius body with...   |   B'day present for my nephew Newer »
This thread is closed to new comments.