aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-userdemo/clearinterfaces.sh
diff options
context:
space:
mode:
authorKeith Burns (alagalah) <alagalah@gmail.com>2016-08-07 09:51:05 -0700
committerKeith Burns (alagalah) <alagalah@gmail.com>2016-08-07 09:51:05 -0700
commitbee3dc863f8f2f23b4a35cd0838ba677451b45d7 (patch)
tree7d152917001ffdfed1f57d51a8785223f4604eae /vpp-userdemo/clearinterfaces.sh
parentf560a490cddc6cd7f97f0693ad5a98f424695422 (diff)
Adding subproject: vpp-userdemo
Change-Id: I79eb30c7a4130d1cf12277a68bb417b5778e9f9c Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
Diffstat (limited to 'vpp-userdemo/clearinterfaces.sh')
-rwxr-xr-xvpp-userdemo/clearinterfaces.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/vpp-userdemo/clearinterfaces.sh b/vpp-userdemo/clearinterfaces.sh
new file mode 100755
index 0000000..012c8c3
--- /dev/null
+++ b/vpp-userdemo/clearinterfaces.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2016 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# Capture all the interface IPs, in case we need them later
+ip -o addr show > ~vagrant/ifconfiga
+chown vagrant:vagrant ~vagrant/ifconfiga
+
+# Disable all ethernet interfaces other than the default route
+# interface so VPP will use those interfaces. The VPP auto-blacklist
+# algorithm prevents the use of any physical interface contained in the
+# routing table (i.e. "route --inet --inet6") preventing the theft of
+# the management ethernet interface by VPP from the kernel.
+for intf in $(ls /sys/class/net) ; do
+ if [ -d /sys/class/net/$intf/device ] &&
+ [ "$(route --inet --inet6 | grep default | grep $intf)" == "" ] ; then
+ ifconfig $intf down
+ fi
+done