From f1680c8931853fa556ffbd17093d340fc98d7fba Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Wed, 3 Feb 2016 11:39:07 -0700 Subject: [PATCH] put setcap command in README --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7078b86..0f23f54 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,12 @@ sudo sysctl -w net.ipv4.ping_group_range="0 2147483647" ``` If you do not wish to do this, you can set `pinger.SetPrivileged(true)` and -run as super-user. +use setcap to allow your binary using go-ping to bind to raw sockets +(or just run as super-user): + +``` +setcap cap_net_raw=+ep /bin/goping-binary +``` See [this blog](https://sturmflut.github.io/linux/ubuntu/2015/01/17/unprivileged-icmp-sockets-on-linux/) and [the Go icmp library](https://godoc.org/golang.org/x/net/icmp) for more details.