Solved

HELP! Controlling NIC - Disable without/Reboot

Posted on 2000-05-08
6
1,543 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
UNC paths question 18 85
VLAN Tag for chained network device. 11 70
How often can a passive RFID be polled? 10 112
How to best manage folder and file security 4 112
We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

829 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