I recently got myself an MTNL Triband connection along with which I also had a local broadband connection.
Now I had just one LAN card and consequently just the one "Local Area Connection" in my network connections.
Each of the 2 had separate IPs, masks and gateways and I had to find a quicker way to switch between the 2 LAN-TCP/IP settings. Manually editing the settings each time is obviously too troublesome.
This little trick is pretty useful also if you're constantly swapping between several connections (maybe home and office) on your laptop.
Google to the rescue it was. Here's a neat trick that uses "netsh", a command-line command to change the tcp/ip settings.
Here's how you do it,
Create a text file and copy the following lines of code into the file.
netsh interface ip set address name="Local Area Connection" source=static addr=IP_ADDRESS mask=SUBNET_MASK
netsh interface ip set address name="Local Area Connection" gateway=DEFAULT_FATEWAY gwmetric=0
netsh interface ip set dns name="Local Area Connection" source=static addr=PREFERRED_DNS
netsh interface ip add dns name="Local Area Connection" addr=ALTERNATE_DNS index=2
pause
Replace the yellow text with the respective details of either one of your connections.
(Make sure that file extensions are not hidden and then) Change the extension from .txt to .bat so that it is saved as a batch file.
You can name the files whatever you want. For e.g., I named one as MTNL connection.bat and the other as localnet.bat
2 comments:
Hey Keith Its pretty Simple to add 2 IP add for single LAN card
I have tried 2 IP n 2 gateways too fro the same
But i have same provider (BSNL)
just when u add a IP in network connection
-properties
-in nternet protocol (TCP/IP)
-Advance
Add aditional gateway and IP
thats pretty simple
it worked for me
try it, it may work too
as both triband and BSNl uses same technology
Thanks but you're mistaken here.
I know of that method too!
But the difference here is that, I need to change the entire IP settings for each of my 2 connections. i.e. I've got to use different gateways, subnet masks, DNS servers and IPs.
Only changing the IPs via TCP/IP wouldn't change all of the rest.
That's why I'm using this batch file to carry out all of those changes at once.
Post a Comment