Skip to content

Instantly share code, notes, and snippets.

@brotich
Last active January 3, 2020 09:51
Show Gist options
  • Save brotich/963410faa88fa71bf991e10c8b4fb3a3 to your computer and use it in GitHub Desktop.
Save brotich/963410faa88fa71bf991e10c8b4fb3a3 to your computer and use it in GitHub Desktop.
fix vpn and docker conflct
#!/bin/bash
set -eu -o pipefail
# https://github.com/docker/libnetwork/issues/779#issuecomment-231727303
# this fixes docker unable to start due to ip address conflict
echo "Adding default route to $route_vpn_gateway with /0 mask..."
ip route add default via $route_vpn_gateway
echo "Removing /1 routes..."
ip route del 0.0.0.0/1 via $route_vpn_gateway
ip route del 128.0.0.0/1 via $route_vpn_gateway
...
# add the following the openvpn.config
route-up /usr/local/bin/fix-vpn-routes.sh
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment