I have one machine need can to access two separated network. I need to change the IP address manually and switch the network cable. I know there is some IP Changer software that can manage the IP address configuration. Is there way to change IP address without using UI or third software? E.g. by script or VB?
In article <0D9F8FE1-2C5F-4D1C-80E2-32507E6FA568@microsoft.com>,
AlmonC <AlmonC@discussions.microsoft.com> wrote:
>I have one machine need can to access two separated network. I need to change the IP address manually and switch the network cable. I know there is some IP Changer software that can manage the IP address configuration. Is there way to change IP address without using UI or third software? E.g. by script or VB?
Use the "netsh" command:
netsh interface ip set address <connection> static <ip> <mask>
<gateway> <gateway metric>
For example, to set a static IP address of 192.168.0.254 on the
connection called "Local Area Connection":
netsh interface ip set address "Local Area Connection" static
192.168.0.100 255.255.255.0 192.168.0.254 10
It might not be necessary to change the IP address, because you can
define two static IP addresses for a connection. Define the first
one, as usual, in the connection's TCP/IP properties. Then, click
Advanced and add the second one.
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)
Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.
Yes. Thanks. I am interest about setting two IP address on one network card. What happen if I set two IP address on one interface (multi-home), it already use the primary IP address as sender address which may not reach the default gateway. I also found I can add two default gateway. What happen if the primary IP and default gateway does not work. Will it try to use secondary default gateway and secondary IP address as sender?
"Steve Winograd [MVP]" wrote:
> In article <0D9F8FE1-2C5F-4D1C-80E2-32507E6FA568@microsoft.com>,
> AlmonC <AlmonC@discussions.microsoft.com> wrote:
> >I have one machine need can to access two separated network. I need to change the IP address manually and switch the network cable. I know there is some IP Changer software that can manage the IP address configuration. Is there way to change IP address without using UI or third software? E.g. by script or VB?
>
> Use the "netsh" command:
>
> netsh interface ip set address <connection> static <ip> <mask>
> <gateway> <gateway metric>
>
> For example, to set a static IP address of 192.168.0.254 on the
> connection called "Local Area Connection":
>
> netsh interface ip set address "Local Area Connection" static
> 192.168.0.100 255.255.255.0 192.168.0.254 10
>
> It might not be necessary to change the IP address, because you can
> define two static IP addresses for a connection. Define the first
> one, as usual, in the connection's TCP/IP properties. Then, click
> Advanced and add the second one.
> --
> Best Wishes,
> Steve Winograd, MS-MVP (Windows Networking)
>
> Please post any reply as a follow-up message in the news group
> for everyone to see. I'm sorry, but I don't answer questions
> addressed directly to me in E-mail or news groups.
>
> Microsoft Most Valuable Professional Program
> http://mvp.support.microsoft.com
>
When a dead gateway is detected by TCP, it can direct IP to switch default
gateways to the next gateway in the backup list. If the multiple IPs belong
to the same subnet, all outbound traffic will go away from the first IP
ever.