Questions

Need help with netsh to change IP addresses everytime it's needed

Tags:
+
0 Votes
Locked

Need help with netsh to change IP addresses everytime it's needed

deboogeek
My brother's computer (in another room) is equipped with a cable modem connection. My computer is connected to my brother's computer via a cross cable (a straight cable + jointer + small cross cable so as to change back to straight cable when connecting directly to modem).

ICS is setup on both the computers as required and everything works fine. When my brother is not working on his computer and it is switched off, I cannot connect through the computer's second network card. I have to manually unplug the jointer and the small cross cable and connect the straight cable to the cable modem.

Then, on my computer, I use a MAC address changer so that my network card's address is the same as what my brother's 1st (onboard) network card has. I also have to manually change from the static IP of 192.168.0.2 to "Obtain and IP address automatically".

This way, I am able to connect both ways and with or without the other computer turned on.

Sometimes I have to do this switching thing more than once a day and it is a hassle to change the IP address every time. I had thought of adding another network card to my computer with a static IP and then I only need to switch the cable to the other card. But the other card (old, Winbond) isn't detected in my computer.

I know that netsh is a command that can change IP addresses based on a script, but do not know how to do this. Using the script, I can just double-click the file and the IP would be changed.

Can someone please tell me what I need to add to the script file and what exact netsh commands do I need for the above?

Regards,
RS
  • +
    0 Votes
    Jacky Howe

    How to use the Alternate Configuration feature for multiple network connectivity in Windows XP

    http://support.microsoft.com/kb/283676

    +
    0 Votes
    deboogeek

    I'm using it this way now, and I don't even change the MAC address. Windows just works without complaining about the mac address, even when the same mac is on my brother's computer.

    Thank you, very much!
    Regards,
    RS

    +
    0 Votes
    Jacky Howe

    way to get a second connection.

    +
    0 Votes
    Russell Gates

    Just buy a router and then you don't have to do anything. Like $35-$40 bucks at a supply store? I know sometimes its the fun of doing something but you have to weigh the hassle effect.
    You could also just turn off the cable modem while you reconnect the Ethernet and it'll auto assign an IP address. Cable only assigns the one address and will not auto renew upon disconnection/reconnection. But power down/up will cause a new IP address to be assigned.

    +
    0 Votes
    Russell Gates

    Just buy a router and then you don't have to do anything. Like $35-$40 bucks at a supply store? I know sometimes its the fun of doing something but you have to weigh the hassle effect.
    You could also just turn off the cable modem while you reconnect the Ethernet and it'll auto assign an IP address. Cable only assigns the one address and will not auto renew upon disconnection/reconnection. But power down/up will cause a new IP address to be assigned.

  • +
    0 Votes
    Jacky Howe

    How to use the Alternate Configuration feature for multiple network connectivity in Windows XP

    http://support.microsoft.com/kb/283676

    +
    0 Votes
    deboogeek

    I'm using it this way now, and I don't even change the MAC address. Windows just works without complaining about the mac address, even when the same mac is on my brother's computer.

    Thank you, very much!
    Regards,
    RS

    +
    0 Votes
    Jacky Howe

    way to get a second connection.

    +
    0 Votes
    Russell Gates

    Just buy a router and then you don't have to do anything. Like $35-$40 bucks at a supply store? I know sometimes its the fun of doing something but you have to weigh the hassle effect.
    You could also just turn off the cable modem while you reconnect the Ethernet and it'll auto assign an IP address. Cable only assigns the one address and will not auto renew upon disconnection/reconnection. But power down/up will cause a new IP address to be assigned.

    +
    0 Votes
    Russell Gates

    Just buy a router and then you don't have to do anything. Like $35-$40 bucks at a supply store? I know sometimes its the fun of doing something but you have to weigh the hassle effect.
    You could also just turn off the cable modem while you reconnect the Ethernet and it'll auto assign an IP address. Cable only assigns the one address and will not auto renew upon disconnection/reconnection. But power down/up will cause a new IP address to be assigned.