manbytesgnu_site

Source files for manbytesgnu.org
git clone git://holbrook.no/manbytesgnu_site.git
Log | Files | Refs

20210421_docker_vpn.rst (894B)


      1 Using Docker with VPN
      2 #####################
      3 
      4 :date: 2021-04-21 06:53
      5 :modified: 2021-04-21 06:53
      6 :category: Hygiene
      7 :author: Louis Holbrook
      8 :tags: vpn,openvpn,iproute,docker
      9 :slug: docker-vpn
     10 :summary: Using docker network while openvpn in running
     11 :lang: en
     12 :status: draft
     13 
     14 
     15 Need to route through the tun interface, which Docker doesn't seem to automatically do.
     16 
     17 .. code-block:: bash
     18 
     19         $ ip route ls
     20         [...]
     21         10.7.3.0/24 dev tun0 proto kernel scope link src 10.7.3.6 
     22 
     23 ::
     24 
     25         ERROR: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network
     26 
     27 The simplest solution I have found is to exchange the gateway redirect from the OpenVPN server [1]_ and add the VPN interface as the default route.
     28 
     29 .. include:: code/docker-vpn/docker_vpn_routes.sh
     30         :code: bash
     31 
     32 
     33 ..
     34 
     35         .. [1] https://stackoverflow.com/a/62333327