Add a way to specify attributes of eth1
Closed this issue · 7 comments
Pipework works very well. The only catch (for me, anyway) is that there's no way to specify attributes of the generated eth1. For example, I want to use eth1 from OpenStack running in Docker. OpenStack requires that its "public" interface run in promiscuous mode (http://docs.openstack.org/grizzly/openstack-compute/install/apt/content/compute-configuring-guest-network.html). Since Pipework is run after the container has started, I have no way of setting eth1 to promiscuous mode without logging into the container and doing it manually.
I got around this by adding:
ip netns exec $NSPID ip link set eth1 promisc on
to the end of the pipework script. This works fine, but wouldn't it be cool to be able to specify a set of attributes to apply to eth1 as it's created?
I'm not sure that I fully understand!
How do you run Pipework in that case?
Are you running OpenStack in Docker, or Docker in OpenStack?
(I'm sorry if that sounds like a stupid question, but both options are actually possible, and that changes a lot of things :-))
Thank you for your feedback!
I'm running OpenStack in Docker containers. After I start up the control node I issue pipework commands to set up eth1. That all works great. Of course, the resulting eth1 interface isn't running in promiscuous mode. This isn't normally an issue, but OpenStack requires promiscuous mode. Adding the line I mentioned above to pipework sets the interface properly.
Understood.
On a normal machine, I assume that you would do ip set eth1 promisc on
; so would it be possible to do the same inside the container? E.g. from the OpenStack startup script?
I guess I could, but the interface wouldn't be there at that point. Pipework has to run after the container has started - and OpenStack starts up on container start. Or am I missing something? I apologize if I am.
Understood (again:-))
There is one possibility: you can copy Pipework to the container (with ADD
or whatever your want), and run pipework --wait
. It will wait for the interface to show up:
https://github.com/jpetazzo/pipework#wait-for-the-network-to-be-ready
Would that be acceptable for you?
(Note: when Pipework gets integrated into Docker, this step won't be necessary anymore, but pipework --wait
will work anyway for backward compatibility. At least, that's what we're aiming for!)
Yes, I'm looking forward to Pipework being built into Docker. :) Actually, adding the one line to the Pipework script works for me for the time being. I just thought it would be convenient to be able to specify something like promiscuous mode on the Pipework command line so that the interface is created that way. Thanks for the suggestions, though!
Okay! I'll close this issue, unless you have further questions about this topic.
Thanks again!