Code Monkey home page Code Monkey logo

Comments (6)

workhardcc avatar workhardcc commented on June 29, 2024 6

sudo sysctl -w net.ipv4.ping_group_range="0 2147483647"

But I want use it in docker container...

from ping.

cbluth avatar cbluth commented on June 29, 2024 2

On Mac, it could use unprivileged, but on some Linux, you should use privileged and have sudo permission.

I am experiencing this issue on ubuntu 18.04 with or without using sudo

EDIT:
after adding pinger.SetPrivileged(true) it works with sudo

from ping.

workhardcc avatar workhardcc commented on June 29, 2024

I have the same issue

from ping.

jwriteclub avatar jwriteclub commented on June 29, 2024

Unfortunately, given the nature of linux this will not be easily solved.

It would be nice if a distinct error was thrown in this situation, in order to allow capturing and informing the user that permissions are wrong, or otherwise handling it automatically.

from ping.

nicoxb avatar nicoxb commented on June 29, 2024

On Mac, it could use unprivileged, but on some Linux, you should use privileged and have sudo permission.

from ping.

sparrc avatar sparrc commented on June 29, 2024

I believe the issue here is spelled out in https://github.com/sparrc/go-ping#note-on-linux-support.

Unfortunately the default linux ping command runs with special permissions that allows regular users to send ICMP packets. This is not possible to solve for an arbitrary go library so there's nothing this library can do about it.

from ping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.