Solved

HELP! Controlling NIC - Disable without/Reboot

Posted on 2000-05-08
6
1,508 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Nslookup is a command line driven utility supplied as part of most Windows operating systems that can reveal information related to domain names and the Internet Protocol (IP) addresses associated with them. In simple terms, it is a tool that can …
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now