Hot answers tagged

17

Assuming the Firewall is turned off, then in order to ping $HOSTNAME, there has to be some form of sharing or service enabled in System Preferences > Sharing, or add an entry to the /etc/hosts file, depending on how/what you're trying to access by $HOSTNAME. Example, 127.0.0.1 computer_name where computer_name is what's reported by echo $HOSTNAME or in lieu ...


9

The obvious choice would be if stealth mode were on. That blocks pings to localhost on all my Mac OS systems. Go to System Preferences, Security & Privacy, Firewall, Firewall Options... Also, if you have "Block all incoming connections" that might also affect things. I would certainly turn off LittleSnitch since it also can and will block that sort of ...


8

Or ping the broadcast address ping -c 3 192.168.1.255 | grep 'bytes from' | awk '{ print $4 }' | sort | uniq


7

There's really nothing to worry about - what you're seeing are ICMP redirects, and they are not a problem as such. The reasoning behind what you're seeing is this: Your MBP usually has the MAC address of wwwelc in its ARP cache. Similarly, SWITCH1 and SWITCH2 knows on which of their ports the computer with the MAC-address of wwwelc is connected. This means ...


7

Use ping -q -n -s $SIZE -c $COUNT $myHost | awk -v host=$myhost '/packet loss/ {print host, $7}' inside the loop. In case you only want to print the hosts with packet loss use ping -q -n -s $SIZE -c $COUNT $myHost | awk -v host=$myhost '/packet loss/ {if ($7 != "0.0%") print host, $7}' Side note: grep pattern | awk '{action}' can usually be ...


7

pingsender is a component of Firefox used by Mozilla for telemetry. The ping sender is a minimalistic program whose sole purpose is to deliver a telemetry ping. https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/docs/internals/pingsender.rst


6

Create a new Inbound Rule that allows traffic over UDP port 5353 in the needed security zones. Step-by-step: Open Windows Firewall Advanced Settings Create a new rule in Inbound Rules Under Protocols and Rules, choose Protocol Type > UDP and Specific Ports > 5353 Choose the appropriate security zones for your network. For more information on security ...


6

So a little while ago I was having wireless problems and wrote a little monitoring tool that was really just a wrapper around ping. I still find it useful for displaying current connectivity at a glance. But I also added the ability for it to write a log of its connectivity, and then wrote a perl script to parse the log and display a summary graph. It ...


6

Looking at the man page for ping (man ping); under the -i wait option, we see that the default time between sending pings is 1 second: -i wait wait seconds between sending each packet. The default is to wait for one second between each packet. So, using the default of sending 1 packet every 1 second, the options -t and -c will produce the same ...


5

ping -n -i 0.1 google.com This should do it at 10/sec (works fine in my testing). (-i sets the interval wait in seconds).


4

Try running the following command if you need low latency for something like online gaming. It continuously pings your router every 200ms to stop the new 802.11ac Broadcom chip in the 2013 Haswell Macs from ever going to sleep. ping -i 0.2 `netstat -nr | grep -m 1 '^default' | awk '{print $2;}'` Hopefully, Apple will provide a proper fix for this in the ...


4

The ping on Mavericks is badly broken. The reason for this is Mavericks puts network card into a power save mode within milliseconds when there's no traffic that it considers vital, and apparently it doesn't consider pings to be valuable traffic, therefore the network card (or, rather, wifi card) goes to "sleep" immediately, and it takes time for it to do so,...


4

Let's take a look at the source code for Apple's ping implementation. Notably, we see this: if (getuid()) s = socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP); else s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); sockerrno = errno; getuid returns 0 if root. So this code is saying, "open the socket in DGRAM (datagram mode) if we are not root. If we are root, ...


3

Little Snitch may have the feature you want. It allows you to set up rules on network traffic, both inbound and outbound, mostly for blocking unwanted traffic, but I believe it can perform arbitrary actions such as notification for specific rules and types of traffic like ICMP pings. There's a trial version that you can use to test. I have no affiliation ...


3

Try this: ping -c 1 google.com | grep "time=" | sed -E "s/(.*)time=([.0-9]+) ms/\2/" If you want to get an minimal value for some number of requests use: ping -q -c 5 google.com | tail -1 | cut -d "=" -f 2 | cut -d "/" -f 1 Replace 1 in -f 1 with: 2 for average 3 for maximum


2

This issue affected several people after upgrading to Mountain Lion. For many, reducing their MTU size solved the issue: Open System Preferences. Select Network. Select your connection and choose Advanced... Select Hardware. Change Configuration to Manually Reduce the MTU size to 1300. Most people had good experiences with this value. Observe how ping ...


2

Here is a 1st draft of a simple sonar: $ cat >sonar.pl <<____eof #!/usr/bin/perl use strict ; use warnings ; $< == 0 || die "$0: should be run as root" ; my $host = `hostname` ; chomp ($host) ; # the targetted tcpdump buffered my $command = "tcpdump -i en1 -l -n -q \'dst host " . $host . " and ( icmp[icmptype] != icmp-echoreply )...


2

First, it seems your wireless router seems to have some firewall part preventing ICMP messages (ping is one part of this protocol suite) going over the wireless lan to prevent a ping flood. To verify this, try out these tests: Disable any VPN software you may run (VPN software mostly includes Desktop policies preventing "unwanted" protocols to be executed ...


2

There are several possible explanations for negative ping times: You are running OS X on a PC with a AMD Athlon™ 64 X2 Dual Core Processor which has a bug in the power management which may not only effect Windows but also OS X installations. Google is tired of getting pinged 38325 times and is sending erroneous timestamps in the ICMP echo replies - ...


1

I had a problem that presented very similarly to yours: excellent ping over wifi, except that every 6 seconds or so it would spike up to 100-200 ms. This was true regardless of the wifi network I was on, or the router hardware. I had no issue when connected via ethernet. My problem ended up being related to a program which was regularly scanning for wifi ...


1

It's wifi - there may be nothing to "fix" if you have lots of other people using wifi, especially on the same channel as you. Wifi is a shared resource. Cabled connections are not (and always better if you have a choice). Are you in a house or apartment? How many of your neighbors are using wifi? Are you using channel 1, 6 or 11 on 2GHz? More ...


1

Ping can be suppressed by a firewall, so I like to take a more overall view. I would choose one thing that Macs can share like Screen Sharing and File Sharing and turn them on on both Macs. I would check if the time of day is correct on both (since some deviation past a few hundred seconds can cause visibility errors in some sharing tasks). This also ...


1

I guess there might be easier way, but it works for me: #!/bin/bash TRESHOLD=10 while $(true); do time=$(ping -c 1 google.com | grep time | cut -d ' ' -f 7 | cut -d '=' -f 2 | cut -d '.' -f 1) if [ $time -lt $TRESHOLD ]; then echo "Less than $TRESHOLD ($time), continue" sleep 1 else echo "More than $TRESHOLD ($time),...


1

What is the error message you get when you are pinging from the terminal? try an nslookup www.google.com and make sure that your dns is resolving correctly


1

It's highly likely pings are blocked somewhere upstream from you.


1

For those searching around: I was also hitting a wall with this issue, where ping and scutil were working with expected results but the dig command failed on everything - google, local network, company network, etc... The issue was that dig was not able to read my /etc/resolv.conf file. I fixed it with a quick chmod on my resolv.conf file. sudo chmod 644 ...


1

I'm still not sure what was causing the problem, but after suffering from another seemingly unrelated issue, I did a complete re-install of 10.8. I had originally upgraded from 10.6 -- though the utilities had seemed to work fine for a while after the initial upgrade, my suspicion is that I did something to some unknown-to-me configuration while attempting ...


1

Ruling out a bad cable or port is an excellent first step. A bad cable or a bad switch port is at least as likely as a bad ethernet port on the iMac. I would start by swapping the cable and switch port for known good ones. Swap the cable and port with a computer that you are sure does not demonstrate the problem. Write down what you did, and when you did it, ...


Only top voted, non community-wiki answers of a minimum length are eligible