Possible? [SOLVED]
Results 1 to 8 of 8

Thread: Possible? [SOLVED]

  1. #1
    Join Date
    Apr 2004
    Location
    Essex, UK
    Posts
    3,313

    Resolved Possible? [SOLVED]

    I was wondering:

    Is it, or is it not possible to set all IP details through DOS?

    Here is what I am trying to acheive.

    My Wireless PCMCIA Card can (obviously) set to DHCP or static. When I am using it for work, mostly is DHCP. But at home I run Static.

    I was hoping I could basically double click a script of some sort (batch file-style) that would automatically set either DHCP or my home Static IP details, without any more user intervention. Saves having to go to Network Control Panel, TCP/IP, Properties, etc etc. YOu get me.

    Thanks!

    HOng

  2. #2
    Join Date
    May 2004
    Location
    Colorado, USA
    Posts
    230
    Use two different hardware profiles - one for work and one for home.
    CataclysmCow

  3. #3
    Join Date
    Apr 2004
    Location
    Essex, UK
    Posts
    3,313
    Thats one solution: thanks. I guess i'll use that idea for now.

    This is why I like Linux...no bother rebooting, all I have to do is run a script and its all done!!

    HOng

  4. #4
    Join Date
    Jan 2003
    Location
    US
    Posts
    5,634
    If you are using Windows XP, you can set the machine to obtain an IP address automatically and configure one alternative static IP. For more information, see the following MS KB Article.

    How to use the Alternate Configuration feature for multiple network connectivity in Windows XP
    http://support.microsoft.com/default...b;en-us;283676

    You can also use the "netsh" command to specify the IP configuration for multiple networks. You can type it a command prompt or include it in a .bat file.

    To specify a fixed address:

    netsh interface ip set address <connection> static <ip> <mask>
    <gateway> <gateway metric>

    For example:

    netsh interface ip set address "Local Area Connection" static
    192.168.0.100 255.255.255.0 192.168.0.254 10

    netsh interface ip set address "Wireless Network Connection" static
    10.20.30.100 255.0.0.0 10.0.0.1 20

    To specify a DHCP address:

    netsh interface ip set address <connection> dhcp

    For example:

    netsh interface ip set address "Local Area Connection" dhcp

    How to Use the NETSH Command to Change from Static IP Address to DHCP in Windows 2000
    http://support.microsoft.com/default...b;en-us;257748
    Eric

  5. #5
    Join Date
    Apr 2004
    Location
    Essex, UK
    Posts
    3,313
    Thanks ecross!!

    I have one question.

    I made 2 batch files, one for static (home) and one for DHCP. The dhcp one works, but the static one just hangs there.

    My suspicsion in the gateway metric... I put it in as 0, but thats a guess. What is it? What does it refer to? Has it anything to do with OSPF type routing?

    Thanks

    Hong

  6. #6
    Join Date
    Apr 2004
    Location
    Essex, UK
    Posts
    3,313
    Ok, works now. Just took a while

    But still...what is gateway metric?

  7. #7
    Join Date
    Jan 2003
    Location
    US
    Posts
    5,634
    An explanation of the Automatic Metric feature for Internet Protocol routes
    http://support.microsoft.com/default...b;en-us;299540
    Eric

  8. #8
    Join Date
    Apr 2004
    Location
    Essex, UK
    Posts
    3,313
    Got it.

    Thanks!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •