Friday, September 25, 2009

Defining my laptop computer's wireless IP settings

My company gave me a laptop computer a few months ago, primarily to help me when I visit the company's various sites, which are spread out across the country. All of these sites have a wireless network, which requires the computer's wireless network card to be defined as DHCP. No problem.

The problems begin when I get home and I want to use the mobile computer; the kibbutz network requires fixed IP addresses. So far, I've been accessing the network card's settings and changing them manually. This is getting to be a drag, and today I learnt how to build two batch files which will set the values automatically. These files don't execute any quicker than setting the values manually, but they're much easier.

First of all, here are the commands necessary to set the wireless card to use DHCP:
netsh interface ip set address name="Wireless Network Connection" source=dhcp
netsh interface ip set dns name="Wireless Network Connection" source=dhcp

I created a batch file called 'dhcp.bat' and added those two lines to the file.

Setting the fixed ip addresses was a bit more complicated, because there are more values to list, and because I need two dns addresses (by experiment, it seems that the secondary dns server would seem to be more important than the primary, but this may change).
netsh interface ip set address name="Wireless Network Connection" static 10.0.90.82 255.0.0.0 10.0.0.1 1
netsh interface ip set dns name="Wireless Network Connection" source=static addr=212.117.128.3 register=primary
netsh interface ip add dns name="Wireless Network Connection" addr=212.117.129.6 index=2

Note that the first line (set address) has three different addresses: the first is the address of the wireless card, the second is the mask and the third is the address of the gateway. Following these addresses is a parameter "1". It seems that the command processor is prepared to read the values without the need to specify what they are. Alternatively, this line could be written in full as
Netsh interface ip set address name=”Local Area Connection” source=static addr=10.0.90.82 mask=255.0.0.0 gateway=10.0.0.1 gwmetric=1

As I never use a network cable to connect the laptop to the kibbutz network, I can leave the settings of the standard network card as dhcp.




1 comment:

Anonymous said...

Can anyone recommend the top performing Network Management software for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: N-able N-central network performance
? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!