TechToggle

Technology Bites Right At The Click Of Your Mouse

Automate Network Configuration and Internet Proxy Settings

Author : Abdul Haseeb, Posts:36

Passionate Entrepreneur and Technology Blogger. Doing Computer Systems Engineering from CEME , NUST. Pakistan

Share

With increasing usage of laptop computers and netbook computers, more and more people use internet via WiFi or Lan or WiMax (in the future).  Every network has its own network configuration settings. It is quite a headache to change network settings manually, time and again. Therfore it is very useful to automate this process using batch files method.

For example if i go to university in the morning, then go to my office and then comeback home in the evening. I use internet on all these domains with WiFi of my Notebook. The problem is that i need to change TCP/IP and proxy settings for each place every day. I thought of automating this process and came up with the solution. It might not be the perfect one but it works really nice for me.

There are two steps to do this task.

  1. Automate Network TCP/IP settings.
  2. Automate Internet Proxy/Lan Settings.

Required files are shown in figure.

reqd files

Automate Network TCP/IP settings

We will create a batch file to automate this process. The basic command used in this method is 'Netsh'.

basic template of the batch file is like this.

Netsh interface ip set address name="Wireless Network Connection" source=static addr=xxx.xxx.xxx.xxx mask=xxx.xxx.xxx.xxx
Netsh interface ip set address name="Wireless Network Connection" gateway=xxx.xxx.xxx.xxx gwmetric=0
Netsh interface ip set dns name="Wireless Network Connection" source=static addr=xxx.xxx.xxx.xxx
Netsh interface ip add dns name = "Wireless Network Connection" addr = xxx.xxx.xxx.xxx

To modify this template as you require, you need to change the name (wireless Network Connection)  with your connection name.  Supply desired IP addresses with the locations xxx.xxx.xxx.xxx .

Home Settings:

Picture below shows the required settings of home template which are automatic dhcp with no proxy settings.

home

You can get the batch file for this type of setting from Here.

Office Settings:

picture below shows the required settings of office template which are static IP address, gateway and DNS address.

Office

You can get batch file of above settings from Here.

Remember to change name and addresses as your requirement.

University Settings:

this template uses static IP addresses, gateway =none, DNS=none with proxy server enabled.

University

You can get batch file of above settings from Here.

Remember to change name and addresses as your requirement. I hope these files work file for most of my friends.

Automate Internet Proxy/Lan Settings:

For internet explorer and Google chrome users regedit merge .reg file will do the work.

To enable proxy settings.

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="172.16.56.56:80"
proxy

To disable Proxy settings.

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000000
"ProxyServer"="172.16.0.1:80"
noproxy

Change proxy address as you require.

Get .reg files from Here.

Extract these files on the same folder where .bat files are located. Then modify each batch file and add this line at the end of each file.

regedit /s xxx.reg

replace xxx with office or home or university for respective batch files.

For firefox users there is an Add-on which will do the task . you can get the add-on from Here.

Thats it you are done. Just double click the required batch file and automated settings will be done.

StumbleIt | Digg | Reddit | Tweet | Facebook | Technorati | Delicious | Ping.fm | Slashdot

Comments on this Article

  • Dan says:

    Thank you. This blog really helped me out a lot. The information was very easy for me to understand.

  • Hamid says:

    A very useful information. Thanks Haseeb for a real good shortcut…

  • Bilal Bhatti says:

    Excellent. It is always a tiresome job to enter new TCP/IP settings again and again in my university while travelling from one department to other. One more thing i would like to mention here that haseeb did this trick in MS Windows through registry editor, in LINUX you can create a shell script and make a bash file for each IP Settings, this is what called bash scripting in LINUX and its far more powerful than windows reg…

  • Shahid says:

    Really helpful!

  • Pete says:

    Thanks Haseeb!
    I’ve been wondering about network set-up and settings. This is very helpful info.

    Thanks, Pete

  • Susan says:

    I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

    Susan

  • Bilal Bhatti says:

    @Susan: You have already enjoyed many blogs i guess, Have a look
    Just want to tell my visitors not to accept such comments as these are just meant to increase back links or spamming purpose :P

  • eyelor007 says:

    Nice job! The best ideas are the simplified one’s.

  • Alex says:

    Thank you! My mother has been attempting the work-from-home thing part time, and your batch scripts were amazingly useful for simplifying the network configuration.

Post A Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.