go-ping / ping

ICMP Ping library for Go
MIT License
1.31k stars 344 forks source link

bind: cannot assign requested address #211

Closed rstriquer closed 2 years ago

rstriquer commented 2 years ago

I used the library to perform a simple ping, I created a network on Amazon with 3 machines, a main ubuntu 20.04, another Amazon Linux 2 and a third, also ubunto.

When I ping from the first one to the others through the internal network as root everything goes well, but if I try the same with the other machines then it generates the problem "bind: cannot assign requested address".

Performing the ping with the shell program everything flows normally, and I can also connect with the first machine from the others 2 to make posts using the command "client.Do" but the ping does not work.

Does anyone have ever seen this?

Thanks,

CHTJonas commented 2 years ago

Thanks for the report. Please could you share some code that demonstrates the issue and the IP addresses/firewall/NAT config of your hosts? I assume you are running under root on all three machines?

When you say "ping with the shell program" do you mean the distro's /bin/ping executable or the go-ping example binary at cmd/ping/ping.go?

rstriquer commented 2 years ago

Thanks to "very simple example" given by the repository I identified the issue.

I had forgotten I used "Source" so it was trying to connect to an inexistent interface. It's been a while I don't code this guy and forgot I put it in there!

I'll take the opportunity to recommend others whom come here with the same problem look for the parameter in their code, if you find "Source" there could be the problem.

Sorry for my misunderstanding. I'll be closing the issue. Thank you for your attention. I hope to collaborate in the future with something more concise and useful.