Created
January 14, 2016 20:26
-
-
Save coreone/9842e00ae6ffd27a111a to your computer and use it in GitHub Desktop.
Fix Docker route on Mac after a VPN session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NETRANGE='10.255.0.0/24' | |
VBOXINF=$( ifconfig | grep vboxnet | grep '<UP' | awk -F':' '{print $1}' ) | |
netstat -rn | grep -q '^10\.255' | |
if [ $? -eq 0 ]; then | |
echo "route already exists" | |
exit 0 | |
fi | |
sudo route add -net $NETRANGE -interface $VBOXINF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment