Windows/Firewall: Difference between revisions
< Windows
Created page with "== Allow ICMP == netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=block IPv6 version: netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol=icmpv6:8,any dir=in action=allow netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo requ..." |
No edit summary |
||
| Line 8: | Line 8: | ||
netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol=icmpv6:8,any dir=in action=allow | netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol=icmpv6:8,any dir=in action=allow | ||
netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol=icmpv6:8,any dir=in action=block | netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol=icmpv6:8,any dir=in action=block | ||
Enable Firewall Rule (powershell): (as needed) | |||
# check firewall rule - should have been auto created | |||
Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" | |||
# Check if our firewall rule below has been added | |||
Get-NetFirewallRule -Name "OpenSSH Server (sshd)" | |||
# search for any (not case sensitive) | |||
Get-NetFirewallRule -Name "*ssh*" | |||
Get-NetFirewallRule -DisplayName "*ssh*" | |||
# if need to create a new one: (Allowed on Domain,Private,Public) | |||
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 | |||
# With Edge Traversal | |||
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 -EdgeTraversalPolicy Allow | |||
# If you want it just on Private | |||
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 -Profile Private | |||
Change firewall rule to just private: | |||
Set-NetFirewallRule -Name sshd -Profile Private | |||
# to Domain,Private | |||
Set-NetFirewallRule -Name sshd -Profile Domain,Private | |||
Verify: | |||
NetFirewallRule -Name sshd | Select-Object Name, Profile, Enabled | |||
Revision as of 18:58, 12 November 2026
Allow ICMP
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=block
IPv6 version:
netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol=icmpv6:8,any dir=in action=allow netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol=icmpv6:8,any dir=in action=block
Enable Firewall Rule (powershell): (as needed)
# check firewall rule - should have been auto created Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP"
# Check if our firewall rule below has been added Get-NetFirewallRule -Name "OpenSSH Server (sshd)"
# search for any (not case sensitive) Get-NetFirewallRule -Name "*ssh*" Get-NetFirewallRule -DisplayName "*ssh*"
# if need to create a new one: (Allowed on Domain,Private,Public) New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
# With Edge Traversal New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 -EdgeTraversalPolicy Allow
# If you want it just on Private New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 -Profile Private
Change firewall rule to just private:
Set-NetFirewallRule -Name sshd -Profile Private # to Domain,Private Set-NetFirewallRule -Name sshd -Profile Domain,Private
Verify:
NetFirewallRule -Name sshd | Select-Object Name, Profile, Enabled