1) Go to the control panel of the server from Windows charm bar or search for ‘control’. Open ‘Windows Firewall’.
2) Click on ‘Advanced Settings’.
3) You need to create a firewall rule that permits ICMP echo packets that are used in the ping command.
This rule is already there in Windows 2012 server and only requires enabling.
To enable the inbound rule to permit ICMP packets, select ‘Inbound Rules’. right click on ‘File and Printer Sharing (Echo Request –ICMPv4-In’), and select Enable Rule.
This will allow incoming ping requests in a Windows 2012 R2 server and respond to them without completely disabling firewall service.
The screen below shows how the Windows 2012 R2 server started responding to the ping request once the above rule was enabled.