Skip to content

Instantly share code, notes, and snippets.

@coreone
Created January 14, 2016 20:26
Show Gist options
  • Save coreone/9842e00ae6ffd27a111a to your computer and use it in GitHub Desktop.
Save coreone/9842e00ae6ffd27a111a to your computer and use it in GitHub Desktop.
Fix Docker route on Mac after a VPN session
#!/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