Page 1 of 1 1
Topic Options
#162434 - 2006-05-24 06:49 PM Unbind TCP/IP Protocol per adapter using SetIPOptions()?
jdogg Offline
Getting the hang of it

Registered: 2003-09-11
Posts: 91
Loc: RTP, North Cakalaka, USA
Hi All,
I am trying to figure out a way (hopefully using KiX) to unbind the TCP/IP protocol from a specific network adapter. This method is faster than enabling/disabling the entire adapter... however, netsh does not seem to be any help here. I stumbled upon SetIPOptions and this seems like a useful UDF, but maybe falls short for what I am looking for. Does anyone know of a way to do this? What I would like to do is unbind TCP/IP from one of the network adapters that I select, and be able to bind it back using the same script.
Thanks for any direction you may provide.
-Jdogg

Top
#162435 - 2006-05-24 07:15 PM Re: Unbind TCP/IP Protocol per adapter using SetIPOptions()?
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4572
Loc: USA
What are you trying to accomplish by doing this. Maybe there is something else to try.
_________________________
(... better days ahead)

Top
#162436 - 2006-05-24 07:25 PM Re: Unbind TCP/IP Protocol per adapter using SetIPOptions()?
jdogg Offline
Getting the hang of it

Registered: 2003-09-11
Posts: 91
Loc: RTP, North Cakalaka, USA
Well, my and my colleagues have the company network connection and a wireless open connection (i.e. no proxy/firewall). I used to be able to easily switch between the two by disabling my wired connection and enabling wireless. However, since I installed VMWare workstation, disabling my adapters rarely works at all without a reboot. I do need VMware installed though, so removing it isn't an option.

Anyway, I figured out that if I go into the wired connection and uncheck TCP/IP, all traffic goes through the wireless connection. I can then enable TCP/IP on the wired connection and I am back behind the firewall.

I was hoping to use a KiX, VB, or some other script to disable TCP/IP on the wired adapter, and then maybe have a different script that I can click on to re-enable it.

Thanks for the quick response and the nice UDF, Allen!
-Jdogg

Top
#162437 - 2006-05-24 07:39 PM Re: Unbind TCP/IP Protocol per adapter using SetIPOptions()?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
OMG! A setup like that would get you fired around here.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#162438 - 2006-05-24 07:41 PM Re: Unbind TCP/IP Protocol per adapter using SetIPOptions()?
jdogg Offline
Getting the hang of it

Registered: 2003-09-11
Posts: 91
Loc: RTP, North Cakalaka, USA
Yeah... I hear ya Les. We are the cops, though.
They hire us to police their employees. We don't police ourselves.

Top
#162439 - 2006-05-24 08:51 PM Re: Unbind TCP/IP Protocol per adapter using SetIPOptions()?
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4572
Loc: USA
http://www.jsifaq.com/subJ/tip4700/rh4705.htm
_________________________
(... better days ahead)

Top
#162440 - 2006-05-24 09:12 PM Re: Unbind TCP/IP Protocol per adapter using SetIPOptions()?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Hey, I used that to unbind the NetWare protocol years ago.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#162441 - 2006-05-24 09:28 PM Re: Unbind TCP/IP Protocol per adapter using SetIPOptions()?
jdogg Offline
Getting the hang of it

Registered: 2003-09-11
Posts: 91
Loc: RTP, North Cakalaka, USA
That thing looks dangerous. Won't that unbind TCP/IP for all adapters and not just specific ones?
As I mentioned, I would like my wireless adapter to remain binded while my wired one is not.

Thanks for all the help.

Top
#162442 - 2006-05-24 10:00 PM Re: Unbind TCP/IP Protocol per adapter using SetIPOptions()?
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4572
Loc: USA
I dont know of anything else but devcon.exe, which will disable the adapter. I played with this about a year ago and created NICToggle.kix.

Code:
break on
$=setoption("WrapATEOL","on")
$nic="PCI\CC_0200"


shell '%comspec% /c devcon status ' + $nic + ' > "' + @scriptdir + '\status.tmp"'
$fh=freefilehandle()
if open($fh,@scriptdir + "\status.tmp")=0
$line=readline($fh)
while @error=0 and $changed=0
select
case instr($line,"Driver is running")>0
shell '%comspec% /c devcon disable ' + $nic + ' 1>Nul 2>&1'
$changed=1
case instr($line,"Device is disabled")>0
shell '%comspec% /c devcon enable ' + $nic + ' 1>Nul 2>&1'
$changed=1
endselect
$line=readline($fh)
loop
$=close($fh)
endif



If you play with devcon's listing features you should be able to target the specific adapter you want to disable/enable.

This may not be the best way, but its an option.
_________________________
(... better days ahead)

Top
#162443 - 2006-05-25 01:52 PM Re: Unbind TCP/IP Protocol per adapter using SetIPOptions()?
jdogg Offline
Getting the hang of it

Registered: 2003-09-11
Posts: 91
Loc: RTP, North Cakalaka, USA
Ok... thanks for all the help. I will give devcon a try.
Thanks guys!
-Jdogg

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.074 seconds in which 0.039 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org