Ed Warnicke | d6a0fc5 | 2016-04-12 17:34:48 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Capture all the interface IPs, in case we need them later |
| 4 | ip -o addr show > ~vagrant/ifconfiga |
| 5 | chown 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. |
| 12 | for 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 Mestery | acc1fbc | 2018-08-10 16:32:13 -0500 | [diff] [blame] | 15 | sudo -E ifconfig $intf down |
Ed Warnicke | d6a0fc5 | 2016-04-12 17:34:48 -0500 | [diff] [blame] | 16 | fi |
| 17 | done |