If you need to allow ping to a Windows Server 2012 R2 computer, you need to unblock ping in the firewall and the best way to do this is via group policy. To allow ping in the Windows Server 2012 R2 firewall, edit this group policy:
Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Windows Firewall with Advanced Security -> Windows Firewall with Advanced Security -> Inbound Rules
Create a new Inbound rule (right click new rule), Select Predefined and choose File and Printer Sharing (I know that doesn’t sound like a Ping firewall rule, but trust me). Then click Next and File and Printer Sharing (Echo Request – ICMPv4In) (or v6 if you want to allow IPv6 Ping) and click Next. Click Allow the connection and click Finish to create the rule.