Questions tagged [netsh]
The netsh tag has no usage guidance.
214
questions
1
vote
0
answers
34
views
Set Windows Firwall to block all outbound but allow DHCP and web use
I am trying to set Windows firewall to block default public profile, but am having difficulty when outbound activity is set to block by default, despite including allow rules for DHCP and DNS.
Failure ...
0
votes
1
answer
57
views
Create Hotspot Without WPA or Password
Setting up a network for my area to provide free WIFI, but there doesn't seem to be a way to create a hotspot without WPA2 even using the netsh commands with empty password like I see repeated 1000 ...
0
votes
1
answer
47
views
Backup & Restore Winsock?
In the process of doing some troubleshooting and running the netsh winsock reset command, and was wondering if anyone is aware of a way (or app) to backup the current winsock catalog (and/or ...
0
votes
1
answer
177
views
Blocking an ip with netsh
I know that netsh advfirewall firewall add rule name="name" dir=out remoteip=%IP% protocol=TCP action=block
blocks the IP, and we can find the IP by simply pinging it.
I used to use it to ...
1
vote
0
answers
72
views
Can't remove port from excludedportrange
I cannot remove port 80 from excludedportrange. Here's the complete list of exclusions (run in elevated cmd):
C:\Users\CptBartender>netsh int ipv4 show excludedportrange protocol=tcp
Protocol tcp ...
0
votes
0
answers
15
views
Facing an issue after running “netsh wlan show profiles” command [duplicate]
I want to retrieve password of an old WiFi connection but when I run `netsh wlan show profile command it shows:
what should I do?
1
vote
1
answer
107
views
How can I escape single quotes in cmd parameter?
I wanted to display a network profile in cmd using netsh, with netsh wlan show profile name="JohnDoe's iPhone". This WiFi name has an apostrophe in it, as you can see. The command responds ...
0
votes
0
answers
29
views
Windows Event to signal removed network adapters
I am looking for a way to programmatically recognize when a network adapter under windows is removed. In particular, I want to get noticed when a network adapter disappears from Control Panel\Network ...
0
votes
0
answers
31
views
Persist virtual network after reboot in Windows
I'm not sure in the terms, but I create "virtual" network in Windows by running netsh interface ip add address "vEthernet (WSL)" 192.168.99.1 255.255.255.0 command. It does all I ...
0
votes
1
answer
341
views
How do I create and setup a network interface for Windows 10 on a VPS?
I've installed Windows 10 on a VPS machine. Now I'm connected to the virtual terminal to access RDP and it says no internet connection.
I've opened terminal and now looking at the interfaces so far, ...
0
votes
1
answer
987
views
Create batch to add firewall rules
Is there anyway to create a batch to run the following codes ? I made the batch file but not able to get the job done.
:Allow IPV4 Ping
netsh advfirewall firewall add rule name="ICMP ...
1
vote
2
answers
693
views
Connect if disconnected and disconnect if connected with batch [duplicate]
I'm trying to do a one-line batch command (for use with autohotkey with a keybaord shortcut) to:
disconnect Wifi if it is connected: netsh wlan disconnect
connect to SSID="MyWifi" if Wifi ...
0
votes
0
answers
2k
views
netsh fails to set MTU
I'm trying to set the MTU for a Mellanox 100Gb NIC using netsh. The command works for small MTU values, but it fails for anything larger than 2000. The card is a ConnectX-6 and I know it supports ...
0
votes
1
answer
123
views
Network changes lost on quick hard reboot
On Windows 10, if I change the IP address and perform a hard reboot a few seconds later (cut the power and restart after some momemts) the change does not persist, i.e. the IP address is back to what ...
1
vote
1
answer
295
views
DOS batch file to display netsh channel output
I'm trying to get wifi Channel output from netsh command to be 2.4GHz or 5GHz
The following provides me with Channel output:
netsh wlan show interface name=Wi-Fi | findstr "Channel"
Output ...
0
votes
1
answer
1k
views
Netsh wlan show profile name=NetworkName key= clear does not show WiFi Password
When I run Netsh wlan show profile name=NetworkName key=clear for some of the wifi networks listed with netshw wlan show profiles from an Admin command prompt the Security section shows Security Key ...
0
votes
0
answers
386
views
Windows terminal open on startup with proxy error
Every time I start my computer (Windows 11) windows terminal opened in C:\WINDOWS\system32\netsh.exe pops up with an error:
Error writing proxy settings. (5) Access is denied.
Current WinHTTP proxy ...
0
votes
1
answer
1k
views
Getting 169.254.31.218 IP address / can't ipconfig /release to change IP address
I can't figure this out and it's become a nightmare.
A computer on our network has no internet. If I plug the problem computer in on another network the internet works. No other computers on the ...
3
votes
1
answer
1k
views
Windows Terminal opens on startup with proxy error
Note: This is a duplicate of When I Start my Windows 11 computer, the terminal pops up saying: Error writing proxy settings. (5) Access is denied which has no clear solution for this problem, as it ...
1
vote
1
answer
131
views
Can't get ip address with wmic command for PPPoP interface
I have tried to get ipv4 address of one of adapters, precisely from "PPPoP WAN Adapter" when it is connected, using wmic nic and wmic nicconfig commands but it didn't work. In general, when ...
0
votes
0
answers
122
views
Enable remote desktop in Windows 8
I am trying to enable Remote Desktop in my old Windows 8 laptop.
I did not find a way to do it via GUI, as I do not have the settings shown everywhere (1, 2, etc.)
This is what I have
The second ...
1
vote
2
answers
1k
views
Access server hosted on 127.0.0.1 within Guest OS from the Host OS in VirtualBox
I have a ColdFusion server that launches on 127.0.0.1:WXYZ within a virtual machine on VirtualBox. I need to be able to access the server from my Host OS. I have tried using a Bridged adapter as well ...
0
votes
0
answers
520
views
netsh.exe keeps popping on Windows 10
I am using Windows 10. The netsh.exe popup saying "The object already exists" shown in this image:
It keeps popping up from time to time. It pops up and goes away. While I am working or ...
0
votes
0
answers
112
views
Windows 10: How to add Network Command Shell (netsh) to Firewall whitelist?
I use the netsh interface portproxy command to proxy connection into my VM. However, Windows Firewall blocks the connection.
I know I can use the netsh advfirewall command to poke a hole. But I would ...
1
vote
2
answers
243
views
PowerShell Script That Toggles Network Connection
I want to write a Powershell script that acts as a toggle for a connection to the internet each time it is run. I wrote this, which works:
$isconnected = netsh wlan show interfaces | select-string ...
1
vote
1
answer
158
views
Reset network settings
In Windows, I ran the command netsh interface ipv4 set address name="Wi-Fi" static 192.168.3.8 255.255.255.0 192.168.3.1. I didn't really know what I was doing and now my Internet is not ...
2
votes
2
answers
187
views
Combining batch files so double click performs one operation and the next double click reverses or performs the next operation?
So I have two separate batch files. One to disable the NIC and enable the wifi card:
@netsh interface set interface name="Ethernet" admin=disabled
@netsh interface set interface name="...
0
votes
0
answers
227
views
Windows 10 no internet access with 4G dongle & LAN
I have the following setup on a remote computer:
Ethernet connection: only for local network - no internet access
4G dongle: internet access
When combining the two, I don't have internet access.
...
1
vote
1
answer
317
views
How to add multiple IPv6 addresses to an interface in Windows?
I can add addresses to an interface using
netsh interface ipv6 add address SomeInterface SomeIPv6Address
Can I somehow add a range of ipv6 addresses e.g. 2001:db8:0000:0000:0000:0000:0000:0001 to ...
0
votes
1
answer
977
views
Local port forwarding - macOs Big Sur
I need to forward all traffic going to 127.0.0.1:5432 to 192.168.1.103:543 on macOS Big Sur. Similar command on Windows is
netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=5432 ...
0
votes
2
answers
308
views
Understanding IP address assignment and routing of hosted network
The hosted network ("Wifi tethering" or "wireless access point") can be enabled with:
netsh wlan set hostednetwork mode=allow ssid=[name] key=[password]
netsh wlan start ...
1
vote
2
answers
616
views
netsh advfirewall command was not found
I have an advanced rule setup in Windows firewall that I want to be able to turn on and off via an AutoHotkey script.
RunWaitOne(command) {
shell := ComObjCreate("WScript.Shell")
...
8
votes
1
answer
4k
views
Find who excluded port range
When trying to start docker container, the following errors is shown:
Cannot start service <service>: Ports are not available: listen tcp 0.0.0.0:5601: bind: An attempt was made to access a ...
1
vote
1
answer
5k
views
What is the exact equivalent of this netsh Windows command for MAC? The command is attached in the body
I want to block all networks from my PC with admin access and make it so that the user cannot reverse the changes. I will use admin access to only white list certain networks that will be visible to ...
0
votes
0
answers
22
views
How to set different TTLHOP for TCP ports
We want to set sensitive TCP/UDP Ports at low TTL/HOP Leaving other ttl/hop at 128 default
data center = 3
Priv net = 8
Internet = 128 default
Ssh 22 = 8 (internal hop max)
Rdp 3389 = 8
Http 80 = 128 (...
3
votes
1
answer
97
views
Performing network connection "diagnose" / "troubleshoot" via command line in Windows
Is there a way in command line to do the steps that Windows 10 does when you right click a network connection and choose "diagnose" or when you tell it to troubleshoot a connection?
I'm ...
26
votes
9
answers
80k
views
Make IP address of WSL2 static
I am running an SSH server within WSL2 on a WIN10 machine. To make that work I am using:
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=22 connectaddress=172.19.237.178 ...
0
votes
1
answer
1k
views
netsh advfirewall can not set group profile
Windows Server 2008 R2 Standard, 64 bit. Powershell version 5.1.144049.
Trying to use a command from this Microsoft Support Page -> Example 8: Enable specific services
netsh advfirewall firewall ...
1
vote
1
answer
3k
views
Change metric of a disconnected interface with netsh
I am creating a Wapt_package to deploy VPN Interface on our user's terminal.
I create the VPN interface without issue, but we need to set the metric of the vpn interface to 1.
add-VPNConnetionRoute -...
0
votes
0
answers
730
views
Slow Internet Speed Windows 10 NETSH WINSOCK fixes it
So I have stumbled upon an extremely annoying task I have to do everyday and that is to run netsh winsock reset catalog everytime I boot into Windows. I have no idea why this has come about but its ...
0
votes
1
answer
66
views
What does the parameter -c for netsh actually do?
The Microsoft Doc says "-c Optional. Specifies that netsh enters the specified netsh context."
I don't understand what the context means here.
Could anyone explain this parameter for me? I would ...
2
votes
1
answer
243
views
Internet Connection Sharing + Port Forwarding range
I'm using Internet Connection Sharing from a Windows 10 computer in order to give a device internet connection and would like to use port forwarding from this connection as well but I need to add a ...
0
votes
1
answer
1k
views
How to route tcp traffic from all/range of ports to a single port?
I would like to do something that's possible with IPTABLES(for linux), on a Windows 10 - that is to route multiple ports to a single port.
I thought I'd manage to do it with netsh, but it doesn't ...
1
vote
1
answer
58
views
How to connect/disconnect a network not found by netsh?
I use a network which can be found with ipconfig but cannot with netsh wlan show networks or netsh wlan show interfaces. I assume this may not be a wlan network but something else. I know it's ...
1
vote
1
answer
868
views
Exclude route from netsh interface
My setup is as follows:
Windows 10, Corona forced home office, I'm an external contractor at a huge company
I'm connecting to the VPN of my company, called MyVPN, some internal IPs of our client are ...
1
vote
1
answer
392
views
How to show keys in netsh without mentioning the name parameter
Queria saber se no netsh show profiles key=clear,ao invés de colocar o ssid de cada rede para ver o "Conteúdo da chave", poderia mostrar de uma forma geral. Já tentei usar o "*" no name,mas não deu ...
3
votes
0
answers
670
views
How to clear the state of Windows filtering platform?
To troubleshoot firewall I use:
netsh wfp show state
this generates xml file for all the dropped packets and firewall state.
the problem is that this file is 13 MB, and it keeps growing each time I ...
1
vote
1
answer
880
views
A Windows 10 service is using ports 80 and 443. How can I change them?
I want to use ports 80 and 443 for Apache server but they are reserved for a windows service as shown by netsh http show urlacl
see output here
Firewall inbound rules show that BranchCache Hosted ...
0
votes
2
answers
453
views
How to create a scheduled task that blocks access to the Internet but not to the local network?
I need your help. I should to create a scheduled task that blocks access to the Internet but I must have access to the local network. Also this task should work on weekdays from 8:00am to 5:00pm.
0
votes
1
answer
4k
views
finding the reason for being disconnected from wifi network
I am behind a firewall known as Sophos. I use Windows 10.
I am facing some challenges in my Windows 10 I am getting frequently disconnected from my wifi .
.There are power outages in my network but ...