Solved

HELP! Controlling NIC - Disable without/Reboot

Posted on 2000-05-08
6
1,553 Views
Last Modified: 2013-12-23
Hi All,

I'm setting up a HA web configuration, where we are using Double Take software to allow us to fail over to a stand-by server when the primary acts up.  It works well when the primary fails hardware or network wise, but when a NT service or application is bad and the OS is running OK, we want to fail over with Double Take.  Now if we execute Double Take fail over, it leaves us with two servers running with the same IP address.  Big problem, right?

What I'm looking for is a way to script an action that will disable the NIC on the primary server, so it is unable to reply to a PING.  This must be done without a reboot, very important.  Can I use an SNMP command, or edit the registry to do this?  

Thanks in advance,
Dan
daniel_figueroa@hp.com
0
Comment
Question by:bigfig
6 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 2789001
All you need to do is disable the devie. I imagine a registry hack would be best.
Also you can disable a service or two if necessary using NT resource tools.
Shutdown can do a remote shutdown.
Kill can kill a process/task
Srvinst can install/uninstall a service.
Check the online help in the resource kit.
Lots of stuff to help out there !!
I hope this helps !

0
 

Author Comment

by:bigfig
ID: 2789045
Regarding your suggestion on killing a process or stopping a service.  Can you tell us which process or service would best disable the network card, without rebooting the system?

Thanks,
Dan
0
 
LVL 2

Expert Comment

by:GHemphill
ID: 2789362
NET STOP Server

This should do the trick!
0
Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

 
LVL 63

Expert Comment

by:SysExpert
ID: 2789383

Delete the NIC from a batch file as shown below.
Other option is to delete the TCp/IP protocol. One of them should do the trick. Other option is trying to do an IP address change on the fly.
I hope this helps.

-----------------
If you are unable to use the Remove button in Control Panel \ Network, use Regedt32 to delete:

 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\<adapter>

 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\NetworkCards\<#>
 (If only one adapter is loaded, <#> will be 1)

 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<adapter>


-----------------
To delete a key using Regedit, include a minus sign in front of the key path.

                        Assume you had the following keys and values:

                        [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Stuff]
                        "GuessWhat"="????"

                        [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Stuff\More]
                        "HostName"="NameHost"

                        [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ZipZap]
                        "GuessWhat"="????"

                        [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ZipZap\Zip]
                        "ZipZap"="ZapZip"
                        [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ZipZap\Zap]
                        "BlahBlah"="string"

                        If you wanted to delete the entire Stuff service and the Zip subkey of the ZipZap service,
                       you would
                        submit the following within a .reg file (including the proper header for your version of
                       Regedit):

                        [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Stuff]

                        [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Stuff\More]

                        [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ZipZap\Zip]

                        If the file name was c:\regdel.reg, then:

                        regedit /s c:\regdel.reg

                        where the optional /s makes it silent.
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 2789395
Other options are using a shell script or WSH script.
---------------------------------
When moving from site to site, it is often necessary to switch between static IP addressing and DHCP.

 This used to be a real pain.

 Using the NETSH command on my Windows 2000 laptoop, I script it, without the need to even restart.

 To implement this technique, determine what adapters / IP addresses you currently have by typing:

 NETSH interface ip show ipaddress

 If you have 2 NICs, the result would look something like:

 MIB-II IP Address Entry
 IP Address       Mask             BC Fmt  Reasm Sz  Interface
 ---------------  ---------------  ------  --------  -----------------------
 127.0.0.1        255.0.0.0             1     65535  Loopback
 192.168.0.50     255.255.255.0         1     65535  Local Area Connection
 216.144.1.126    255.255.254.0         1     65535  Internet

 NOTE: The RemoteAccess service must be started. If it is Disabled, set it to Manual or Automatic. Then type net start remoteaccess.

 To switch the Local Area Connection to DHCP, type:

 netsh interface ip set address "Local Area Connection" dhcp

 To change the Local Area Connection to a static ip address, type:

 netsh interface ip set address "Local Area Connection" static <ipaddr> <subnetmask>
 <gateway> <metric>

 where:

 <ipaddr> is the ip address.

 <subnetmask> is the subnet mask.

 <gateway> is the default gateway.

 <metric> is the metric.

 To change the Local Area Connection to 192.168.0.50, subnet mask 255.255.255.0, default
 gateway 192.168.0.1 and a metric of 1, type:

 netsh interface ip set address "Local Area Connection" static 192.168.0.50 255.255.255.0
 192.168.0.1 1
0
 
LVL 6

Accepted Solution

by:
Portang earned 200 total points
ID: 2791333
Issue the following command will release the IP address for that adapter:

ipconfig /release 3C905B-TX

Where 3C905B-TX is the adapter's name/description.

See ipconfig /? | more for instructions.

Best regards.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
USB on Hyper-V VM Server 2012R2 13 112
VMware ESXi network trunking best practice scenario for iSCSI & NAS ? 8 245
Group Policy Question 7 76
domain and forest trust 1 31
Greetings, Experts! First let me state that this website is top notch. I thoroughly enjoy the community that is shared here; those seeking help and those willing to sacrifice their time to help. It is fantastic. I am writing this article at th…
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question