Commit 7828b3d4 authored by Saverio Proto's avatar Saverio Proto

Initial commit

parents
# Run this Docker container like this:
# docker run --net=host --cap-add NET_ADMIN --env MGMTIPV4=127.0.0.1 --env INTF=ens5 -v /etc/openvswitch:/etc/openvswitch zioproto/docker-l2gw-ovs
FROM ubuntu:16.04
MAINTAINER Saverio Proto <saverio.proto@switch.ch>
RUN apt-get update && \
apt-get -y install iproute2 && \
apt-get -y install openvswitch-vtep && \
ovsdb-tool create /etc/openvswitch/vtep.db /usr/share/openvswitch/vtep.ovsschema && \
ovsdb-tool create /etc/openvswitch/vswitch.db /usr/share/openvswitch/vswitch.ovsschema && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY entrypoint.sh /entrypoint.sh
RUN chown root.root /entrypoint.sh && chmod a+x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
# Build
docker build
# Run
docker run --net=host \
--cap-add NET_ADMIN \
--env MGMTIPV4=127.0.0.1 \
--env INTF=ens5 \
-v /etc/openvswitch:/etc/openvswitch \
zioproto/docker-l2gw-ovs
#!/bin/bash
mkdir /var/run/openvswitch
ovsdb-server --pidfile --detach --log-file \
--remote ptcp:6632:${MGMTIPV4} \
--remote punix:/var/run/openvswitch/db.sock \
--remote=db:hardware_vtep,Global,managers \
/etc/openvswitch/vswitch.db /etc/openvswitch/vtep.db
ovs-vswitchd --log-file --detach --pidfile unix:/var/run/openvswitch/db.sock
ovs-vsctl add-br myphyswitch
vtep-ctl add-ps myphyswitch
vtep-ctl set Physical_Switch myphyswitch tunnel_ips=${MGMTIPV4}
ovs-vsctl add-port myphyswitch ${INTF}
vtep-ctl add-port myphyswitch ${INTF}
/usr/share/openvswitch/scripts/ovs-vtep --log-file=/var/log/openvswitch/ovs-vtep.log --pidfile=/var/run/openvswitch/ovs-vtep.pid --detach myphyswitch
sleep infinity
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment