Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init: allow to create raw ICMP socket as regular user
Starting a vng session as regular user doesn't allow to run ping: $ vng --network user ... $ ping -c1 localhost ping: socktype: SOCK_DGRAM ping: socket: Address family not supported by protocol The reason is that by default the kernel restricts the GIDs that are allowed to create raw ICMP sockets: $ sysctl net.ipv4.ping_group_range net.ipv4.ping_group_range = 1 0 Increase the range of allowed GIDs, so that any regular user is able to run ping. After this change: $ vng --network user ... $ ping -c1 localhost PING localhost (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.091 ms --- localhost ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.091/0.091/0.091/0.000 ms Reported-by: Joel Fernandes <joelagnelf@nvidia.com> Signed-off-by: Andrea Righi <arighi@nvidia.com>
- Loading branch information