blob: 31a63098e870b9310677a4a514c7d7beb5953e6a [file] [log] [blame]
Ed Warnicked6a0fc52016-04-12 17:34:48 -05001#!/bin/bash
2
3# Capture all the interface IPs, in case we need them later
4ip -o addr show > ~vagrant/ifconfiga
5chown vagrant:vagrant ~vagrant/ifconfiga
6
7# Disable all ethernet interfaces other than the default route
8# interface so VPP will use those interfaces. The VPP auto-blacklist
9# algorithm prevents the use of any physical interface contained in the
10# routing table (i.e. "route --inet --inet6") preventing the theft of
11# the management ethernet interface by VPP from the kernel.
12for intf in $(ls /sys/class/net) ; do
13 if [ -d /sys/class/net/$intf/device ] &&
14 [ "$(route --inet --inet6 | grep default | grep $intf)" == "" ] ; then
Kyle Mesteryacc1fbc2018-08-10 16:32:13 -050015 sudo -E ifconfig $intf down
Ed Warnicked6a0fc52016-04-12 17:34:48 -050016 fi
17done