I am trying to create the following configuration. Two (Docker) containers, let's call them by their hostnames (s1 and s2) as described below, each includes Open vSwitch. I want to connect both OVSes each to the other, and to a (POX) controller.
This is what I do (all commands are run with root priveledges if needed):
- Run first container as
docker run -itd -P --hostname=s1 --cap-add NET_ADMIN %DOCKER_IMAGE%
Run the second container as
docker run -itd -P --hostname=s2 --cap-add NET_ADMIN %DOCKER_IMAGE%
2.
docker exec CID_s1 ovs-vsctl add-br s1
(where CID_s1 is the CID of container s1)
docker exec CID_s2 ovs-vsctl add-br s2
3.
On the host machine:
ip link add s1-eth1 type veth peer name s2-eth1
ip link set s1-eth1 netns PID_s1
(where PID_s1 is the PID of container s1)
ip link set s2-eth1 netns PID_s2
4.
Open a terminal on s1 and write:
ovs-vsctl add-port s1 s1-eth1
ip link set s1-eth1 up
ifconfig s1-eth1 10.0.0.1
ovs-vsctl set-controller s1 tcp:172.17.0.1:6633
Open a terminal on s2 and write:
ovs-vsctl add-port s2 s2-eth1
ip link set s2-eth1 up
ifconfig s2-eth1 10.0.0.2
ovs-vsctl set-controller s2 tcp:172.17.0.1:6633
At this moment, the controller shows that the switches have been connected and I can see that the controller has installed flows (the controller acts as a hub, so all actions are actually to flood).
However, I cannot ping from s1 to s2 or the other way (of course using their IP addresses).