X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=INSTALL.Docker.md;h=9e140435c869e05bcadd8d1167add7e465384a6a;hb=f821fe7f09ad0262b63c41f637aa77e02fa9ebfa;hp=ddbef99552f10403fa0bad4a4d53971c9a49f329;hpb=9feb1017c5f16ace32479264aae6d92ed81f0633;p=cascardo%2Fovs.git diff --git a/INSTALL.Docker.md b/INSTALL.Docker.md index ddbef9955..9e140435c 100644 --- a/INSTALL.Docker.md +++ b/INSTALL.Docker.md @@ -2,10 +2,9 @@ How to Use Open vSwitch with Docker ==================================== This document describes how to use Open vSwitch with Docker 1.2.0 or -later. This document assumes that you followed [INSTALL.md] or installed -Open vSwitch from distribution packaging such as a .deb or .rpm. Consult -www.docker.com for instructions on how to install or .rpm. Consult -www.docker.com for instructions on how to install Docker. +later. This document assumes that you installed Open vSwitch by following +[INSTALL.md] or by using the distribution packages such as .deb or .rpm. +Consult www.docker.com for instructions on how to install Docker. Limitations ----------- @@ -56,9 +55,13 @@ and then attaches it to the Open vSwitch bridge 'br-int'. This is done by creating a veth pair. One end of the interface becomes 'eth1' inside the container and the other end attaches to 'br-int'. -The script also lets one to add an IP address to the interface. e.g.: +The script also lets one to add IP address, MAC address, Gateway address and +MTU for the interface. e.g.: -`% ovs-docker add-port br-int eth1 $CONTAINER_ID 192.168.1.1/24` +``` +% ovs-docker add-port br-int eth1 $CONTAINER_ID --ipaddress=192.168.1.2/24 \ +--macaddress=a2:c3:0d:49:7f:f8 --gateway=192.168.1.1 --mtu=1450 +``` * A previously added network interface can be deleted. e.g.: @@ -76,8 +79,22 @@ and del-port[s] commands. Once a container interface is added to an Open vSwitch bridge, one can set VLANs, create Tunnels, add OpenFlow rules etc for more network control. +Many times, it is important that the underlying network infrastructure is +plumbed (or programmed) before the application inside the container starts. +To handle this, one can create a micro-container, attach an Open vSwitch +interface to that container, set the UUIDS in OVSDB as mentioned in +[IntegrationGuide.md] and then program the bridge to handle traffic coming out +of that container. Now, you can start the main container asking it +to share the network of the micro-container. When your application starts, +the underlying network infrastructure would be ready. e.g.: + +``` +% docker run -d --net=container:$MICROCONTAINER_ID ubuntu:14.04 /bin/sh -c \ +"while true; do echo hello world; sleep 1; done" +``` + Please read the man pages of ovs-vsctl, ovs-ofctl, ovs-vswitchd, -ovsdb-server ovs-vswitchd.conf.db etc for more details. +ovsdb-server and ovs-vswitchd.conf.db etc for more details about Open vSwitch. Docker networking is quite flexible and can be used in multiple ways. For more information, please read: @@ -89,3 +106,4 @@ Bug Reporting Please report problems to bugs@openvswitch.org. [INSTALL.md]:INSTALL.md +[IntegrationGuide.md]:IntegrationGuide.md