Search code examples
command-linewindows-xpwindows-firewall

How do I disable a LAN (Local Area Network) connection?


I understand the command to show the Windows XP firewall status is:

netsh firewall show opmode

Which outputs:

enter image description here

To disable firewall type:

netsh firewall set opmode mode=disable profile=all

Which outputs:

enter image description here

But I cannot find the command to disable the Local Area Connection.

How can I do this?

enter image description here


Solution

  • I cannot find the command to disable "Local Area Connection"

    You need to use the interface option of netsh.

    To disable:

    netsh interface set interface "Local Area Connection" admin=disable
    

    To enable:

    netsh interface set interface "Local Area Connection" admin=enable
    

    Notes:

    • Replace Local Area Connection with the interface names of your adapter.
    • Use netsh interface show interface to get the interface name.

    Further Reading