在将Pipework与Docker容器一起使用时,为什么我无法进行RTNETLINK操作? [英] Why am I getting an RTNETLINK Operation Not Permitted when using Pipework with Docker containers?
问题描述
我正在使用Vagrant / VirtualBox运行CoreOS稳定版494.5.0,并正在运行vanilla ruby:2.1.5 Docker映像。我正在尝试使用Pipework将Docker容器连接到本地物理接口(而不是在运行容器时使用-net = host
),以便可以嗅探流量。管道工作在容器中创建 eth1 @ if2
并正确设置其IP地址,但链接最终以 UNKNOWN
状态结束当我尝试使用 ip链接
调出链接时,我得到 RTNETLINK答案:不允许操作
。
I'm running CoreOS stable 494.5.0 using Vagrant/VirtualBox and am running the vanilla ruby:2.1.5 Docker image. I'm trying to use Pipework to connect the Docker container to a local physical interface (as opposed to using --net=host
when running the container) so I can sniff traffic. Pipework creates eth1@if2
in the container and sets its IP address correctly, but the link ends up in the UNKNOWN
state and when I try to bring the link up using ip link
I get RTNETLINK answers: Operation not permitted
.
如果有所作为,我必须使用 ip链接将dev eth1设置为 c而不是
ip链接设置dev eth1 @ if2上
,否则我得到找不到设备 eth1 @ if2
。
If it makes a difference, I have to use ip link set dev eth1 up
instead of ip link set dev eth1@if2 up
or else I get Cannot find device "eth1@if2"
.
任何想法我做错了吗?
推荐答案
默认情况下,Docker容器没有完整的特权。尝试将其添加到 docker run
命令:
Docker containers do not have full privileges by default. Try adding this to the docker run
command:
--cap-add=NET_ADMIN
这篇关于在将Pipework与Docker容器一起使用时,为什么我无法进行RTNETLINK操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!