summaryrefslogtreecommitdiffstats
path: root/examples/docker/bgp_demo/init
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/init
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/init')
-rwxr-xr-xexamples/docker/bgp_demo/init/init.sh44
-rw-r--r--examples/docker/bgp_demo/init/io-fd-hc2vpp-integration_vpp-integration-distribution_1-18-01-SNAPSHOT-module-config27
-rw-r--r--examples/docker/bgp_demo/init/io-fd-honeycomb_minimal-distribution_1-18-01-SNAPSHOT-module-config24
-rw-r--r--examples/docker/bgp_demo/init/vpp1.cmd4
-rw-r--r--examples/docker/bgp_demo/init/vpp2.cmd4
5 files changed, 103 insertions, 0 deletions
diff --git a/examples/docker/bgp_demo/init/init.sh b/examples/docker/bgp_demo/init/init.sh
new file mode 100755
index 000000000..8ed4cd25c
--- /dev/null
+++ b/examples/docker/bgp_demo/init/init.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# Starts and initializes vpp.
+# Then starts honeycomb
+#
+
+NODE_ID=$1
+NODE_NAME=vpp$1
+
+echo "Enable tuntap interface in startup.conf"
+echo -e "tuntap {\n enable\n}\n" >> /etc/vpp/startup.conf
+
+/hc2vpp/vpp/start.sh & VPP_PID=$!
+echo "Waiting 5s for vpp to start"
+sleep 5
+VPP_VERSION=$(vppctl show version)
+if [ "${VPP_VERSION}" != "" ]
+then
+ echo "VPP started successfully. Version:"
+ echo "${VPP_VERSION}"
+else
+ echo "VPP failed to start. Stopping initialization script."
+ exit 1
+fi
+
+# Configure veth interfaces using VPP CLI
+# (not fully supported by hc2vpp 18.01)
+echo "Configuring vpp"
+vppctl exec /hc2vpp/bgp_demo/init/$NODE_NAME.cmd
+
+# Update address of interface BGP is listening on
+IP="10.12.1.${NODE_ID}"
+jshon -s $IP -i "bgp-binding-address" -I -F /opt/honeycomb/config/bgp.json
+
+# Set AS number
+AS_NUMBER=$((65000+NODE_ID))
+jshon -n $AS_NUMBER -i "bgp-as-number" -I -F /opt/honeycomb/config/bgp.json
+
+# Update module configuration
+# Enables BGP and disables some of the modules not used in the example
+cp /hc2vpp/bgp_demo/init/*-module-config /opt/honeycomb/modules
+
+echo "Starting honeycomb"
+/hc2vpp/honeycomb/start.sh
diff --git a/examples/docker/bgp_demo/init/io-fd-hc2vpp-integration_vpp-integration-distribution_1-18-01-SNAPSHOT-module-config b/examples/docker/bgp_demo/init/io-fd-hc2vpp-integration_vpp-integration-distribution_1-18-01-SNAPSHOT-module-config
new file mode 100644
index 000000000..f236d4eab
--- /dev/null
+++ b/examples/docker/bgp_demo/init/io-fd-hc2vpp-integration_vpp-integration-distribution_1-18-01-SNAPSHOT-module-config
@@ -0,0 +1,27 @@
+// This is list of hc2vpp modules based on configuration file from /opt/honeycomb/modules
+//
+// BGP modules (disabled by default) were enabled.
+// Modules not used in the demo were disabled to reduce footprint.
+//
+io.fd.hc2vpp.common.integration.VppCommonModule
+io.fd.hc2vpp.management.VppManagementModule
+// io.fd.hc2vpp.lisp.LispModule
+// io.fd.hc2vpp.lisp.gpe.GpeModule
+io.fd.hc2vpp.v3po.V3poModule
+// io.fd.hc2vpp.iface.role.InterfaceRoleModule
+io.fd.hc2vpp.l3.InterfaceL3Module
+io.fd.hc2vpp.l3.SubInterfaceL3Module
+// io.fd.hc2vpp.l3.ProxyArpModule
+io.fd.hc2vpp.vpp.classifier.VppClassifierModule
+// io.fd.hc2vpp.vpp.classifier.InterfaceClassifierAclModule
+// io.fd.hc2vpp.vpp.classifier.SubInterfaceClassifierAclModule
+// io.fd.hc2vpp.nat.NatModule
+io.fd.hc2vpp.routing.RoutingModule
+// io.fd.hc2vpp.acl.AclModule
+// io.fd.hc2vpp.dhcp.DhcpModule
+// io.fd.hc2vpp.policer.PolicerModule
+io.fd.hc2vpp.mpls.MplsModule
+// io.fd.hc2vpp.vppnsh.impl.VppNshModule
+// io.fd.hc2vpp.vppioam.impl.VppIoamModule
+io.fd.hc2vpp.bgp.inet.BgpInetModule
+io.fd.hc2vpp.bgp.prefix.sid.BgpPrefixSidModule \ No newline at end of file
diff --git a/examples/docker/bgp_demo/init/io-fd-honeycomb_minimal-distribution_1-18-01-SNAPSHOT-module-config b/examples/docker/bgp_demo/init/io-fd-honeycomb_minimal-distribution_1-18-01-SNAPSHOT-module-config
new file mode 100644
index 000000000..476a1a1a5
--- /dev/null
+++ b/examples/docker/bgp_demo/init/io-fd-honeycomb_minimal-distribution_1-18-01-SNAPSHOT-module-config
@@ -0,0 +1,24 @@
+// This is list of honeycomb modules based on configuration file from /opt/honeycomb/modules
+//
+// BGP modules (disabled by default) used in the demo were enabled.
+//
+io.fd.honeycomb.infra.distro.schema.YangBindingProviderModule
+io.fd.honeycomb.infra.distro.schema.SchemaModule
+io.fd.honeycomb.infra.distro.data.ConfigAndOperationalPipelineModule
+io.fd.honeycomb.infra.distro.data.context.ContextPipelineModule
+io.fd.honeycomb.infra.distro.initializer.InitializerPipelineModule
+io.fd.honeycomb.northbound.CredentialsModule
+io.fd.honeycomb.northbound.netconf.NetconfModule
+io.fd.honeycomb.northbound.netconf.NetconfReadersModule
+io.fd.honeycomb.northbound.restconf.RestconfModule
+io.fd.honeycomb.infra.distro.cfgattrs.CfgAttrsModule
+io.fd.honeycomb.infra.bgp.BgpModule
+io.fd.honeycomb.infra.bgp.BgpReadersModule
+io.fd.honeycomb.infra.bgp.BgpWritersModule
+// io.fd.honeycomb.northbound.bgp.extension.EvpnModule
+io.fd.honeycomb.northbound.bgp.extension.InetModule
+// io.fd.honeycomb.northbound.bgp.extension.L3VpnV4Module
+// io.fd.honeycomb.northbound.bgp.extension.L3VpnV6Module
+io.fd.honeycomb.northbound.bgp.extension.LabeledUnicastModule
+// io.fd.honeycomb.northbound.bgp.extension.LinkstateModule
+// io.fd.honeycomb.footprint.FootprintModule \ No newline at end of file
diff --git a/examples/docker/bgp_demo/init/vpp1.cmd b/examples/docker/bgp_demo/init/vpp1.cmd
new file mode 100644
index 000000000..5760f167b
--- /dev/null
+++ b/examples/docker/bgp_demo/init/vpp1.cmd
@@ -0,0 +1,4 @@
+create host-interface name veth12
+set int state host-veth12 up
+set int ip address host-veth12 10.12.1.1/24
+set interface unnumbered tuntap-0 use host-veth12
diff --git a/examples/docker/bgp_demo/init/vpp2.cmd b/examples/docker/bgp_demo/init/vpp2.cmd
new file mode 100644
index 000000000..07f2005e0
--- /dev/null
+++ b/examples/docker/bgp_demo/init/vpp2.cmd
@@ -0,0 +1,4 @@
+create host-interface name veth21
+set int state host-veth21 up
+set int ip address host-veth21 10.12.1.2/24
+set interface unnumbered tuntap-0 use host-veth21