summaryrefslogtreecommitdiffstats
path: root/examples/docker/bgp_demo/build_topology.sh
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-04-30 09:03:13 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-05-02 09:55:56 +0000
commit30b088af1c187d7d3abd65030089c2a56f5cf95b (patch)
treeee427c54a6885d644c69a300407445fefff24628 /examples/docker/bgp_demo/build_topology.sh
parent4b8bef208fc37b09008e3333db9d262d56b94192 (diff)
Move docker files to examples directory
Change-Id: Ib2eb3dbae76a1e9b5d98ce9e0d5eea9adba280cf Signed-off-by: Marek Gradzki <mgradzki@cisco.com> (cherry picked from commit e4c58493ce5265ea0d1e17d160c339401c406186)
Diffstat (limited to 'examples/docker/bgp_demo/build_topology.sh')
-rwxr-xr-xexamples/docker/bgp_demo/build_topology.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/docker/bgp_demo/build_topology.sh b/examples/docker/bgp_demo/build_topology.sh
new file mode 100755
index 000000000..c532916a3
--- /dev/null
+++ b/examples/docker/bgp_demo/build_topology.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+source ../utils.sh
+
+if [[ $UID != 0 ]]; then
+ echo "Please run this script with sudo:"
+ echo "sudo $0 $*"
+ exit 1
+fi
+
+# Cleanup
+../remove_hc2vpp_containers.sh
+
+# Create directory for storing network namespaces
+mkdir -p /var/run/netns
+
+# Build topology
+#
+# vpp1 – vpp2
+#
+create_container vpp1 hc2vpp
+create_container vpp2 hc2vpp
+
+start_container vpp1
+start_container vpp2
+
+# Connect containers using veth interfaces
+create_link vpp1 veth12 veth21 vpp2