I've just installed Windows Server 2008 on a server and I'm able to connect through Remote Desktop but can't ping. Do I need to open an special port on the firewall to be able to ping a server?
Asked
Active
Viewed 6.1k times
7 Answers
14
Enable ping through the Windows Firewall at the command line like so:
netsh firewall set icmpsetting 8
Apparently this has changed in Windows Server 2008 R2 and newer, to:
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request"
protocol=icmpv4:8,any dir=in action=allow
That's.. uh... quite a mouthful.
Jeff Atwood
- 13,264
9
in powershell you can use :
# allow-icmp.ps1
# Sets up windows firewall to allow inbound ICMP - using PowerShell
# Thomas Lee - tfl@psp.co.uk
#create firewall manager object
$FWM=new-object -com hnetcfg.fwmgr
# Get current profile
$pro=$fwm.LocalPolicy.CurrentProfile
# Check Profile
if ($pro.IcmpSettings.AllowInboundEchoRequest) {
"Echo Request already allowed"
} else {
$pro.icmpsettings.AllowInboundEchoRequest=$true
}
# Display ICMP Settings
"Windows Firewall - current ICMP Settings:"
"-----------------------------------------"
$pro.icmpsettings
Alban
- 297
8
You will want to allow ICMP packets through. Ping doesn't use TCP, so there is no port to open.
Justin Scott
- 8,908
5
Run these 2 in admin powershell, it enables both ipv6 and ipv4 inbound pings on all networks (public/private/domain):
Set-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -enabled True
Set-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv6-In)" -enabled True
It is equivalent to this https://serverfault.com/a/6049/147813
CMCDragonkai
- 355
2
Another way of fixing this:
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
Bart De Vos
- 18,171
whizkid
- 355
0
Pay attention to use the correct quotation marks. Some web sites replace the quotation marks by similar symbols which cause syntax errors. C.f. enter link description here
bernd_k
- 141
