Answers:
默认情况下,Windows 2008不响应ping。启用:
管理工具
具有高级安全性的Windows防火墙
入境规则
文件和打印机共享(回显请求-ICMPv4-IN)
启用规则
现在,您应该可以从LAN ping服务器了。
在命令行中通过Windows防火墙启用ping操作,如下所示:
netsh firewall set icmpsetting 8
显然,这已在Windows Server 2008 R2和更高版本中更改为:
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request"
protocol=icmpv4:8,any dir=in action=allow
那是..呃。。。
在PowerShell中,您可以使用:
# 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
在admin powershell中运行以下两个命令,它将在所有网络(公用/专用/域)上启用ipv6和ipv4入站ping:
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