Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^3: Solution to broken Net::Ping

by Generoso (Parson)
on Dec 16, 2011 at 21:16 UTC ( #944015=note: print w/replies, xml ) Need Help??

in reply to Re^2: Solution to broken Net::Ping
in thread Solution to broken Net::Ping

You may want to try.

#!/usr/bin/perl -w use strict; use Net::Ping; $| = 1; my @hosts = <DATA>; my @proto = ("tcp", "udp", "icmp", "stream", "syn"); foreach my $pro ( @proto ) { print "\nProtocol $pro \n"; my $p = Net::Ping->new($pro); foreach my $host( @hosts ) { chomp($host); # Specify source interface of pings print "$host is "; print "NOT " unless $p->ping($host, 2); print "reachable.\n"; } $p->close(); } exit; __DATA__

Replies are listed 'Best First'.
Re^4: Solution to broken Net::Ping
by Anonymous Monk on Dec 16, 2011 at 23:31 UTC
Re^4: Solution to broken Net::Ping
by solignis (Initiate) on Dec 17, 2011 at 07:44 UTC

    ll it seems my script works like should when I on my local network. Where I run into problems is when I am on my vpn. If I run the script while connected to the VPN it cannot ping the host. If I place the script on a server within the network it works fine. So now I need to find out why it is not pinging over the VPN because I do most of my work over it.

    <Disregard my ramblings above>

    I found the issue to the above problem, my "dev" box is a VM, VMware is preforming NAT to the VMs on my laptop. Then on top of that OpenVPN is performing NAT again which seems to be causing problems. If I connect OpenVPN directly to the VM the ping test using my script works like it should.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://944015]
[LanX]: Wilkes left the computer field in 1972 to attend the Harvard Law School
[erix]: too many stubborn, illogical men in IT
LanX "We had the quaint notion at the time that software should be completely, absolutely free of bugs. Unfortunately it's a notion that never really quite caught on." :)
[LanX]: erix Silence, I sue you!
[erix]: She sounds like Dijkstra (you know, Edsger)
LanX will call his fifth son "Edsger"

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (13)
As of 2017-12-12 16:03 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (335 votes). Check out past polls.