Sign inSign up

jzsues/adguard-naive-amd64

By jzsues

Updated about 2 years ago

Transparent proxy use AdGuardHome and NaïveProxy

Image
Networking
0

1.3K

jzsues/adguard-naive-amd64 repository overview

Intro

This Docker image contains the AdGuardHome and NaïveProxy packages, which serve as a transparent proxy.

The image can be utilized to proxy DNS queries.

Domains in the gfwlist will be parsed to the fake IP address(100.64.0.0/10), while other domains will be parsed by 114.114.114.114.

The container will automatically start the naive proxy service and the AdGuardHome service.

The only requirement is to set the NaïveProxy server address in the container environment variable N_PROXY.

The only limitation is that the container must be on the same subnet as the router.

Default AdGuardHome endpoint: http://10.0.0.2

Default AdGuardHome user/password: admin/test@123

Usage

  1. Setup the transparent proxy as below.
  2. Set the DNS address to container IP(default 10.0.0.2) in the router or client machine.
  3. That's all.

Setup

Environment Variables
  • lan cidr: 10.0.0.0/24
  • lan gateway: 10.0.0.1
  • host ip: 10.0.0.1
  • host iface: eth0
  • macvlan bridge ip: 10.0.0.100
  • macvlan bridge iface: macvlan-proxy
  • container ip: 10.0.0.2
Setup macvlan bridge on host machine and enable ip forwarding
ifconfig eth0 promisc
iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE
ip link add macvlan-proxy link eth0 type macvlan mode bridge
ip addr add 10.0.0.100/32 dev macvlan-proxy
ip link set macvlan-proxy up
Add route on host machine
ip route add 10.0.0.2/32 dev macvlan-proxy
ip route add 100.64.0.0/10 via 10.0.0.2
Create docker macvlan network
docker network create -d macvlan --subnet=10.0.0.0/24 --gateway=10.0.0.1 -o parent=eth0 naive-proxy
Create and run proxy container
Run on your router(eg. openwrt)
docker run -d --name naive --network naive-proxy  --ip 10.0.0.2  --cap-add=NET_ADMIN  --cap-add=NET_RAW  --privileged  -e BR_MACVLAN_IP="10.0.0.100" -e N_PROTO=redir -e N_PROXY="https://user:[email protected]" jzsues/adguard-naive-amd64:latest
Run on your other linux server
docker run -d --name naive --network naive-proxy  --ip 10.0.0.2  --cap-add=NET_ADMIN  --cap-add=NET_RAW  --privileged -e N_PROTO=redir -e N_PROXY="https://user:[email protected]" -e N_RESET_DEFAULT_ROUTE=false jzsues/adguard-naive-amd64:latest

Tag summary

Content type

Image

Digest

sha256:fab1eec63

Size

25.1 MB

Last updated

about 2 years ago

docker pull jzsues/adguard-naive-amd64