Skip to content

Instantly share code, notes, and snippets.

@tyilo
Created January 14, 2018 23:12
Show Gist options
  • Select an option

  • Save tyilo/03889ddc651fcf96e1208b65bfc7aa7f to your computer and use it in GitHub Desktop.

Select an option

Save tyilo/03889ddc651fcf96e1208b65bfc7aa7f to your computer and use it in GitHub Desktop.

Revisions

  1. tyilo created this gist Jan 14, 2018.
    31 changes: 31 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    version: "3"

    services:
    vpn:
    image: hwdsl2/ipsec-vpn-server
    env_file:
    - ./vpn.env
    ports:
    - "500:500/udp"
    - "4500:4500/udp"
    privileged: true
    hostname: ipsec-vpn-server
    container_name: ipsec-vpn-server
    volumes:
    - /lib/modules:/lib/modules:ro
    command: >
    bash -c '
    HOST=$$(host -4 mitmproxy | head -1 | awk "{ print \$$4 }") &&
    echo "HOST: $$HOST" &&
    iptables -t nat -A PREROUTING -i eth+ -p tcp --destination-port 80 -j DNAT --to-destination $$HOST:8080 &&
    iptables -t nat -A PREROUTING -i eth+ -p tcp --destination-port 443 -j DNAT --to-destination $$HOST:8080 &&
    /opt/src/run.sh
    '
    mitmproxy:
    image: mitmproxy/mitmproxy
    ports:
    - "8080:8080/tcp"
    hostname: mitmproxy
    container_name: mitmproxy
    command: mitmdump -T --host
    6 changes: 6 additions & 0 deletions vpn.env
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # Define your own values for these variables
    # - DO NOT put "" or '' around values, or add space around =
    # - DO NOT use these special characters within values: \ " '
    VPN_IPSEC_PSK=foobar
    VPN_USER=foo
    VPN_PASSWORD=bar