Compatible Support Forums: Disabling and Enabling network connections using CLI

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Disabling and Enabling network connections using CLI

#1 User is offline   khurram 

  • stranger
  • Group: Members
  • Posts: 5
  • Joined: 19-October 04

Posted 19 October 2004 - 04:22 PM

Hello Everyone,

I want to disable and enable the wired connection (ethernet adapter) in my laptop though command prompt. I am trying to use PEAP using windows XP 802.1x client for user authentication and in some cases, the user will like to enter a different username and password. The 802.1x client in windows prompts for the username and password only when you take out the cable or disable and enable the ethernet connection.

So if anyone can tell me how can i disable and enable a specific interface in windows xp using the command line interface, I will be greatful.

Regards

Khurram
0

#2 User is offline   clutch 

  • Carpal Tunnel
  • Group: Moderators
  • Posts: 3859
  • Joined: 29-March 00

Posted 19 October 2004 - 05:20 PM

Check out
Quote:
netsh /?

and
Quote:
netsh interface /?

0

#3 User is offline   khurram 

  • stranger
  • Group: Members
  • Posts: 5
  • Joined: 19-October 04

Posted 19 October 2004 - 07:03 PM

Hi,

I tried netsh and netsh interface but I could not find any command in that which disables or enables a specific interface. Mostly the commands are to set the parameters for an interface.
0

#4 User is offline   clutch 

  • Carpal Tunnel
  • Group: Moderators
  • Posts: 3859
  • Joined: 29-March 00

Posted 19 October 2004 - 09:25 PM

And if you drill down further in the help in "set", you will notice some more commands. Eventually, you would come up with something like:

Quote:
netsh interface set interface name="Local Area Connection" admin=ENABLED

0

#5 User is offline   khurram 

  • stranger
  • Group: Members
  • Posts: 5
  • Joined: 19-October 04

Posted 20 October 2004 - 11:27 AM

Hi clutch

Thanks for your reply.

I tried this command

netsh interface set interface name="Local Area Connection" admin=ENABLED

But I get the following message

One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for correct syntax.

But if I try the following command, it works and the name of the interface is changed,
netsh interface set interface name="Local Area Connection" newname=LAN1

There is one more thing that it says in the help,

admin - whether the interface should be enabled <non-LAN only>.

But for newname it says,

newname - new name for the interface <LAN only>

I wonder does it mean that I can disable or enable only the logical interfaces and not the physical ones and can change the name for physical ones (as it worked for me)

Thanks again for your help and time. I highly appreciate this.

Khurram
[Edited by khurram on 2004-10-20 06:05:37]

0

#6 User is offline   clutch 

  • Carpal Tunnel
  • Group: Moderators
  • Posts: 3859
  • Joined: 29-March 00

Posted 20 October 2004 - 05:56 PM

http://www.winnetmag.com/Windows/Article/ArticleID/41111/41111.html

Scroll down to a response from yhamade referencing a tool named DevCon. This might do what you are looking for (for others interested, the command works fine with Windows Server 2003, and the version of netsh in XP may not support disabling in this fashion yet).
0

#7 User is offline   khurram 

  • stranger
  • Group: Members
  • Posts: 5
  • Joined: 19-October 04

Posted 20 October 2004 - 07:32 PM

thanks alot for replying again clutch. actually i want to make things easier for the end user .. and in case of devcon, they have to install a tool and then u can run the batch file containing commands to disbale or enable the lan ..

i wonder if there is any other way in windows XP and 2000 that user is prompted by 802.1x client to login the username and password useing PEAP ... i could trigger that login only when I take out the cable from LAN or when I disable it and then enable it again ..

regards

khurram
0

#8 User is offline   ratneshyadav 

  • stranger
  • Group: Members
  • Posts: 1
  • Joined: 01-June 06

Posted 01 June 2006 - 08:51 PM

Enabling:

netsh interface set interface "Local Area Connection " ENABLE


Disabling:

netsh interface set interface "Local Area Connection " DISABLE


Ratnesh
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users