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

I understand the command to show the Windows XP firewall status is:
netsh firewall show opmode
Which outputs:
To disable firewall type:
netsh firewall set opmode mode=disable profile=all
Which outputs:
But I cannot find the command to disable the Local Area Connection.
How can I do this?

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
An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.
netsh - Configure Network Interfaces, Windows Firewall, Routing & remote access.
Netsh commands for Interface IP
Netsh Commands for Wireless Local Area Network (WLAN)

Related

Possible to make vscode use a proxy upstream of remote-ssh?

question:
Is there any way to tunnel all outgoing ssh connections in vscode (including those established by the remote-ssh plugin) through my on-site workstation? I have full control over the firewall for that machine and can open ports on ufw as needed for off-site access.
background:
I use vscode remote-ssh to connect to a research computing cluster when on-site.
For remote work, I would like to avoid using cisco anyconnect as a vpn in mac os 11.6, as routing and other os features behave unexpectedly.
Turns out in mac os, it's sufficient to edit the ~/.ssh/config file by specifying an on-site proxy host that I control within the ProxyCommand option:
Host clusterNode
ProxyCommand ssh me#my_accessible_ssh_host nc %h %p
HostName <firewalled node ip address>
User my_cluster_username

Connect to Mobile Network on Laptop via Commandline

I have a SIM-Card in my Laptop and I want to automate the connection. I have removed the PIN from the SIM-Card. I can disconnect with
netsh mbn disconnect interface="Cellular"
This works. If I try to connect with
netsh mbn connect interface="Cellular"
I get an error, that one or more Parameters are wrong for the command.
I'm using a Windows 10 Machine.
As suggested by B--rian I ended up using
netsh mbn connect interface="Cellular" connmode=name name="{...}"
I had to disable the PIN for this to work.

Redirect port on Windows from loopback to outside

I have a socket that listen on port 6100 on my development machine, whose lan address is 192.168.1.2
I can access the socket and use it with the address 127.0.0.1:6100, but I can't access it from 192.168.1.2:6100 (I need to access the socket from another client on the Lan)
If I type netstat -an | find "6100" on the command prompt I get:
TCP 127.0.0.1:6100 0.0.0.0:0 LISTENING
So I need to redirect all calls to 192.168.1.2:A_RANDOM_PORT to 127.0.0.1:6100
How can i do that?
I tried with:
netsh interface portproxy add v4tov4 listenport=6200 listenaddress=192.168.1.2 connectport=6100 connectaddress=127.0.0.1
But without luck
I've finally been able to accomplish this task, but only using an external tool.
I downloaded "PassPort port forwarding utility" and set up a redirection from 192.168.1.2 to 127.0.0.1
Unfortunately I haven't been able to do that without an external tool.
You failed to post the code concerned, but you bound your listening socket to 127.0.0.1 instead of 0.0.0.0. Just fix that. No oort forwarding required.

at windows 7 - how to create wifi access point with "open" authentication?

win-7
i set my laptop to be access point but windows force me to use WPA2 as authentication for the user connected .
i want to change the authentication level to OPEN instead WPA2 how i can do it ?
i used the following commands :
Open cmd window as administrator and typed the following commands :
netsh wlan set profileorder name="profile1" interface="Wireless Network Connection 4"
netsh wlan set hostednetwork mode=allow ssid=v2v_AP key=alvarion keyUsage=persistent
netsh wlan start hostednetwork

Changing IP address via command line on Windows XP

I'm trying to change a machine IP address via cmd.exe with this code:
netsh int ip set address name="Local Area Connection" source=static addr=???.???.???.??? mask=255.255.255.0
The problem that the IP doesn't change (checked by ipconfig) but doesn't not changed on the DHCP. Thus when I restart the machine, the IP is returned to DHCP.
I need a way to change the IP permanently via command line.
Any ideas?
You can use the command below:
netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1
where
the 192.168.0.100 is the IP address
the netmask is 255.255.255.0
and the gateway is 192.168.0.1
You can also have the DNS configured automatically by DHCP using following command:
netsh interface ip set dns "Local Area Connection" dhcp
If you are looking for change it regularly here is a trick :)
netsh interface ip set address name="Wi-Fi" static 192.168.1.140 255.255.255.0 192.168.1.1 // this change IP
netsh interface ip add dns name="Wi-Fi" 8.8.8.8 index=2 //this change DNS
pause
type above in notepad and save as ip.bat.
run the file as administrator