Skip to content

Murakumo-JP/AntiZapretVPN

 
 

Repository files navigation

AntiZapret VPN in Docker

Antizapret created to redirect only blocked domains to VPN tunnel. Its called split tunneling. This repo is based on idea from original AntiZapret LXD image

Support and discussions group:

https://t.me/antizapret_support

How works?

  1. List of blocked domains downloaded from open registry.
  2. List parsed and rules for dns resolver (adguardhome) created.
  3. Adguardhome resend requests for blocked domains to python script dnsmap.py.
  4. Python script: a) resolve real address for domain b) create fake address from 10.244.0.0/15 subnet c) create iptables rule to forward all packets from fake ip to real ip.
  5. Fake IP is sent in DNS response to client
  6. All vpn tunnels configured with split tunneling. Only traffic to 10.244.0.0/15 subnet is routed through VPN.

Features

  • openvpn-dco - a kernel extension for improving performance of OpenVPN
  • Multiple VPN transports: Wireguard, OpenVPN, IPsec/XAuth ("Cisco IPsec")
  • Adguard as main DNS resolver
  • filebrowser as web viewer & editor for *-custom.txt files
  • Unified dashboard
  • Optional built-in reverse proxy based on caddy

Installation

  1. Install Docker Engine:
    curl -fsSL https://get.docker.com -o get-docker.sh
    sudo sh get-docker.sh
  2. Clone repository and start container:
    git clone https://github.com/Murakumo-JP/AntiZapretVPN.git antizapret
    cd antizapret
  3. Create docker-compose.override.yml with services you need. Minimal example with only wireguard:
services:
  antizapret:
    environment:
      - ADGUARDHOME_PASSWORD=somestrongpassword
  wireguard:
     environment:
        - WIREGUARD_PASSWORD=somestrongpassword
     extends:
        file: services/wireguard/docker-compose.yml
        service: wireguard
     depends_on:
        - antizapret

Find full example in docker-compose.override.sample.yml

  1. Start services:
   docker compose pull
   docker compose build
   docker compose up -d
   docker system prune -f

Access admin panels:

HTTP:

By default panels have following http ports exposed to internet:

  • dashboard: no exposed port
  • adguard: 3000
  • filebrowser: 2000
  • openvpn: 8080
  • wireguard: 51821
  • wireguard-amnezia: 51831

If you do not wish to expose ports to internet override them in docker-compose.override.yml. In this example adguard and wireguard admin panels are removed from internet, and wireguard udp server is exposed:

services:
   antizapret:
      environment:
         - ADGUARDHOME_USERNAME=admin
         - ADGUARDHOME_PASSWORD=password
      ports: !reset []

   wireguard:
      extends:
         file: services/wireguard/docker-compose.yml
         service: wireguard
      environment:
         - WIREGUARD_PASSWORD=password
      ports: !override
         - 51820:51820/udp

HTTPS

To enable https server and create self-signed certificates - add proxy container to docker-compose.override.yml When proxy container is started, access services with https at following ports at your host ip:

  • dashboard: 443
  • adguard: 1443
  • filebrowser: 2443
  • openvpn: 3443
  • wireguard: 4443
  • wireguard-amnezia: 5443

proxy container is optional.

Local network

When you connected to VPN, you can access containers without exposing ports to internet:

Update

git pull
docker compose pull
docker compose build
docker compose down --remove-orphans && docker compose up -d --remove-orphans

Reset:

Remove all settings, vpn configs and return initial state of service:

docker compose down
rm -rf config/*
docker compose up -d

Credits

About

Docker container with antizapret-vpn for selfhosting.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 42.5%
  • CSS 22.1%
  • Python 20.2%
  • Dockerfile 7.6%
  • JavaScript 3.8%
  • Go 2.0%
  • Other 1.8%