revision bee3dc86
1#!/usr/bin/env bash
3# Copyright (c) 2016 Cisco and/or its affiliates.
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at:
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
17# Capture all the interface IPs, in case we need them later
18ip -o addr show > ~vagrant/ifconfiga
19chown vagrant:vagrant ~vagrant/ifconfiga
21# Disable all ethernet interfaces other than the default route
22# interface so VPP will use those interfaces.  The VPP auto-blacklist
23# algorithm prevents the use of any physical interface contained in the
24# routing table (i.e. "route --inet --inet6") preventing the theft of
25# the management ethernet interface by VPP from the kernel.
26for intf in $(ls /sys/class/net) ; do
27    if [ -d /sys/class/net/$intf/device ] &&
28        [ "$(route --inet --inet6 | grep default | grep $intf)" == "" ] ; then
29        ifconfig $intf down
30    fi