ifconfig:无法在RHEL7.3上的Centos 7容器中打开/ proc / net / dev

时间:2017-09-10 06:08:31

标签: docker redhat rhel ifconfig redhat-containers

我在运行" ifconfig"时遇到此错误我的CentOS 7容器中的命令

我得到的错误是

cannot open /proc/net/dev (Permission Denied)

如何解决这个问题.. ???我在每个容器中都遇到了这个问题。我完全允许/ proc / net / dev但它没有工作

1 个答案:

答案 0 :(得分:0)

在不知道您的docker run ...命令行的情况下,很难猜到,但也许您想在运行命令中添加--cap-add=NET_ADMIN

来自here

For interacting with the network stack, instead of using --privileged they should use --cap-add=NET_ADMIN to modify the network interfaces.