Question:
How to change IP addresses of my laptop quickly?
Platinum
2010-03-25 22:29:14 UTC
I am using my laptop to connect to net both from my home and office.
The IP configuration in both the places are totally different. Everyday I need to change the addresses and some configuration twice.
Is there any easy way to do it ?
I have tried with different Hardware profiles but its not helping as the Hardware remains same in both place.

Other details --
My home and office both IP is Static.
sub-netsubdifferentiferent
Both Gatedifferentiferent.
Office is with 10BaseT connection and Home with 100BaseT connection.
If I set Auto Detect in NIC speed selection it does not work in Office but works well in home.
Three answers:
dawkins_tom
2010-03-25 22:58:11 UTC
Maybe you can make a batch file and use netsh to change it with a click:



netsh interface ipv4 set address name="Local Area Connection" static 10.0.0.1 255.0.0.0 10.0.0.254



You can type in a similar command into a text file and name in chgIPOffice.bat or chgIPHome.bat or whatever you want then click it to change your IP address....



Thats an example that would set Local Area Connection TCP4

Address to 10.0.0.1

Mask to 255.0.0.0

Gateway 10.0.0.254



You can see the doc for netsh, I am assuming you are running Windows because you said hardware profile yes?





***** NETSH DOC for interface/ipv4/set/address *****







Usage: set address [name=]

[[source=]dhcp|static]

[[address=][/] [[mask=]]

[[gateway=]|none [gwmetric=]]

[[type=]unicast|anycast]

[[subinterface=]]

[[store=]active|persistent]



Parameters:



Tag Value

name - Interface name or index.

source - One of the following values:

dhcp: Enables DHCP for configuring IP addresses for

the specified interface.

static: Disables DHCP for configuring IP addresses for

the specified interface.

address - IPv4 address to add or modify, optionally followed by

the subnet prefix length.

mask - The IP subnet mask for the specified IP address.

gateway - One of the following values:

: A specific default gateway for the

static IP address you are setting.

none: No default gateways are set. This is the default.

gwmetric - The metric for the default gateway. This field should

be set only if gateway is specified.

type - One of the following values:

unicast: Marks the address as a unicast address.

This is the default.

anycast: Marks the address as an anycast address.

subinterface - LUID of the subinterface on which the default gateway

exists. This parameter is only needed on interfaces

with multiple subinterfaces.

store - One of the following values:

active: Set only lasts until next boot.

persistent: Set is persistent. This is the default.



Remarks: Used to enabled or disable DHCP for IP address configuration.

Also removes any previous static IP addresses and default gateways,

and can add a new static IP address and default gateway.



Examples:



set address name="Local Area Connection" source=dhcp

set address "Local Area connection" static 10.0.0.9 255.0.0.0 10.0.0.1 1
?
2010-03-25 22:40:28 UTC
You could create a batch file. One named Home.bat and one named Office.bat



In each of the files you could enter the appropriate commands for example lets say that your Home IP address was 192.168.17.9 and the subnet was 255.255.255.0 and the Gateway was 192.168.17.1 and the DNS server was 192.168.17.1



So in this batch file you create you would put the following:



netsh

interface ip set address name=”My Network Card Name Here” static 192.168.17.9 255.255.255.0 192.168.17.1



interface ip set dns “My Network Card Name Here” static 192.168.17.1





You could create this file using notebook. But when you save the file you want to use save as and change the file extension to .bat instead of .txt.



Now you could just click the file and it would run the command and set the appropriate IP address settings.



Note: The "My Network Card Name Here" should be replaced with whatever your network card is tagged with. Typically this will be "Local Area Connection"
Tapojyoti Acharya
2010-03-25 22:32:32 UTC
Create A shortcut Of your Network Adapter on the desktop or Use TCPIP Manager

http://sourceforge.net/projects/tcpipmanager/


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...