added example VNFs for emulator (not finally tested)
authorpeusterm <manuel.peuster@uni-paderborn.de>
Tue, 21 Jun 2016 06:48:17 +0000 (08:48 +0200)
committerpeusterm <manuel.peuster@uni-paderborn.de>
Tue, 21 Jun 2016 06:48:17 +0000 (08:48 +0200)
misc/vnfs/build_push.sh [new file with mode: 0755]
misc/vnfs/firewall/Dockerfile [new file with mode: 0644]
misc/vnfs/firewall/start.sh [new file with mode: 0644]
misc/vnfs/iperf/Dockerfile [new file with mode: 0644]
misc/vnfs/iperf/start.sh [new file with mode: 0644]
misc/vnfs/tcpdump/Dockerfile [new file with mode: 0644]
misc/vnfs/tcpdump/start.sh [new file with mode: 0644]

diff --git a/misc/vnfs/build_push.sh b/misc/vnfs/build_push.sh
new file mode 100755 (executable)
index 0000000..df5e66e
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+# build
+cd firewall; docker build -t mpeuster/firewall-vnf .
+cd ..
+cd iperf; docker build -t mpeuster/iperf-vnf .
+cd ..
+cd tcpdump; docker build -t mpeuster/tcpdump-vnf .
+cd ..
+
+# push
+docker push mpeuster/firewall-vnf
+docker push mpeuster/iperf-vnf
+docker push mpeuster/tcpdump-vnf
\ No newline at end of file
diff --git a/misc/vnfs/firewall/Dockerfile b/misc/vnfs/firewall/Dockerfile
new file mode 100644 (file)
index 0000000..971ab19
--- /dev/null
@@ -0,0 +1,22 @@
+FROM      ubuntu
+MAINTAINER iMinds
+
+RUN apt-get update && apt-get install -y \
+       iptables \
+       arptables \
+       ebtables \
+       bridge-utils \
+       tcpdump \
+       openvswitch-switch \
+       openvswitch-common
+       
+RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump
+
+ADD start.sh start.sh
+RUN chmod +x start.sh
+
+# emulator specific entrypoint
+ENV SON_EMU_CMD ./start.sh
+
+# always use bash as defauld command
+CMD /bin/bash
\ No newline at end of file
diff --git a/misc/vnfs/firewall/start.sh b/misc/vnfs/firewall/start.sh
new file mode 100644 (file)
index 0000000..5b9c4c3
--- /dev/null
@@ -0,0 +1,26 @@
+#! /bin/bash
+
+#This gives time to the Dockernet to configure the network namespace of the container
+sleep 3
+
+echo "Ubuntu started"
+echo "start ovs"
+service openvswitch-switch start
+
+NAME='fw'
+
+#echo "setup ovs bridge"
+ovs-vsctl add-br $NAME
+#ovs-vsctl set bridge $NAME datapath_type=netdev
+ovs-vsctl set bridge $NAME protocols=OpenFlow10,OpenFlow12,OpenFlow13
+#ovs-vsctl set-fail-mode $NAME secure
+#ovs-vsctl set bridge $NAME other_config:disable-in-band=true
+
+ovs-vsctl add-port $NAME ${NAME}-eth0
+
+#send out through same interface, on single port
+ovs-ofctl add-flow $NAME 'in_port=1,action=in_port'
+
+# iptables -I FORWARD -m physdev --physdev-in eth0 --physdev-out eth1 -d 8.8.8.8 -j DROP
+
+echo "Firewall started"
diff --git a/misc/vnfs/iperf/Dockerfile b/misc/vnfs/iperf/Dockerfile
new file mode 100644 (file)
index 0000000..6696f64
--- /dev/null
@@ -0,0 +1,16 @@
+FROM      ubuntu
+MAINTAINER iMinds
+
+RUN apt-get update && apt-get install -y \
+       mz \
+       iperf
+
+
+ADD start.sh start.sh
+RUN chmod +x start.sh
+
+# emulator specific entrypoint
+ENV SON_EMU_CMD ./start.sh
+
+# always use bash as defauld command
+CMD /bin/bash
\ No newline at end of file
diff --git a/misc/vnfs/iperf/start.sh b/misc/vnfs/iperf/start.sh
new file mode 100644 (file)
index 0000000..d252976
--- /dev/null
@@ -0,0 +1,6 @@
+#! /bin/bash
+
+#This gives time to the Dockernet to configure the network namespace of the container
+sleep 3
+
+echo "Traffic sink started"
diff --git a/misc/vnfs/tcpdump/Dockerfile b/misc/vnfs/tcpdump/Dockerfile
new file mode 100644 (file)
index 0000000..e14570f
--- /dev/null
@@ -0,0 +1,16 @@
+FROM      ubuntu
+MAINTAINER iMinds
+
+RUN apt-get update && apt-get install -y \
+       tcpdump
+
+RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump
+
+ADD start.sh start.sh
+RUN chmod +x start.sh
+
+# emulator specific entrypoint
+ENV SON_EMU_CMD ./start.sh
+
+# always use bash as defauld command
+CMD /bin/bash
\ No newline at end of file
diff --git a/misc/vnfs/tcpdump/start.sh b/misc/vnfs/tcpdump/start.sh
new file mode 100644 (file)
index 0000000..e3ffe66
--- /dev/null
@@ -0,0 +1,7 @@
+#! /bin/bash
+
+#This gives time to the Dockernet to configure the network namespace of the container
+sleep 3
+
+
+echo "Traffic sink started"
\ No newline at end of file