Solved

HELP! Controlling NIC - Disable without/Reboot

Posted on 2000-05-08
6
1,521 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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

A common practice in small networks is making file sharing easy which works extremely well when intra-network security is not an issue. In essence, everyone, that is "Everyone", is given access to all of the shared files - often the entire C: drive …
Resolve DNS query failed errors for Exchange
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

24 Experts available now in Live!

Get 1:1 Help Now