{"id":4033,"date":"2021-05-24T14:02:42","date_gmt":"2021-05-24T19:02:42","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=4033"},"modified":"2021-05-24T14:02:42","modified_gmt":"2021-05-24T19:02:42","slug":"ping-multiple-ip-addresses-to-see-if-they-are-up-or-down","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/ping-multiple-ip-addresses-to-see-if-they-are-up-or-down\/","title":{"rendered":"Ping multiple IP addresses to see if they are up or down"},"content":{"rendered":"\n<p>An easy way to do this is by using fping.  fping is a little bit easier ping utility to use then normal ping when trying to verify that a host is actually down.<\/p>\n\n\n\n<p>By default fping returns if a host is &#8220;alive&#8221; or &#8220;unreachable&#8221;<\/p>\n\n\n\n<p>Example: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ fping 192.168.1.4<br>192.168.1.4 is alive<\/pre>\n\n\n\n<p>Or for a host that is down it returns something like the following<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ fping 192.168.1.5<br>ICMP Host Unreachable from 192.168.1.2 for ICMP Echo sent to 192.168.1.5<br>ICMP Host Unreachable from 192.168.1.2 for ICMP Echo sent to 192.168.1.5<br>ICMP Host Unreachable from 192.168.1.2 for ICMP Echo sent to 192.168.1.5<br>ICMP Host Unreachable from 192.168.1.2 for ICMP Echo sent to 192.168.1.5<br>192.168.1.5 is unreachable<\/pre>\n\n\n\n<p>You can adjust the retry rate with the -r option, default is 3 which it has multiple of the Host Unreachable lines.  Changing it to 1 or 2 gets rid of those lines so it just shows that the host is unreachable.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ fping -r 1 192.168.1.5\n192.168.1.5 is unreachable<\/pre>\n\n\n\n<p><strong>Ping multiple addresses<\/strong><\/p>\n\n\n\n<p>Fortunately pinging multiple addresses with fping is as easy as adding them to the end of the command.  For example<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">fping -r1 192.168.1.1 192.168.1.2<\/pre>\n\n\n\n<p>will ping both the specified addresses one after the other and print the results to the terminal.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ fping -r 192.168.1.1 192.168.1.10 192.168.1.45  \n192.168.1.1 is alive\n192.168.1.10 is alive\n192.168.1.45 is unreachable<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>An easy way to do this is by using fping. fping is a little bit easier ping utility to use then normal ping when trying to verify that a host is actually down. By default fping returns if a host &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/ping-multiple-ip-addresses-to-see-if-they-are-up-or-down\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,1222],"tags":[355,161,1221],"class_list":["post-4033","post","type-post","status-publish","format-standard","hentry","category-linux","category-tips-and-tricks","tag-fping","tag-ping","tag-tricks"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=4033"}],"version-history":[{"count":1,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4033\/revisions"}],"predecessor-version":[{"id":4034,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4033\/revisions\/4034"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=4033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=4033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=4033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}