Where do I start to debug a network problem?
Your Mac is probably behind a proxy.  This article explains how to configure proxy settings on your Mac.  If you are behind a proxy, then you probably will not be able to get ping to work.

Otherwise, the first step to troubleshooting a connectivity issue when Safari is working is to use traceroute to some well-maintained destination.  I typically use google.com.  

traceroute google.com


If you get the error unknown host google.com then you have a DNS problem.  Otherwise traceroute should provide you with information that helps you pinpoint the problem.