Sign inSign up

superxiao666/clash2

By superxiao666

•Updated 3 months ago

Clash Premium + Zashboard-Ui + Preloaded Configuration

Image
0

5.4K

superxiao666/clash2 repository overview

⁠普通模式(不使用 TUN)

⁠适用于:

  • HTTP/SOCKS 代理
  • Redir 模式
  • 路由器旁路由
  • 不需要透明代理
docker run -d \
  --name clash \
  --restart unless-stopped \
  -p 7890:7890 \
  -p 3128:3128 \
  -p 7891:7891 \
  -p 9090:9090 \
  -p 53:53/tcp \
  -p 53:53/udp \
  superxiao666/clash2:latest

⁠TUN 模式(推荐)

⁠适用于:

  • 全局透明代理
  • Fake-IP
  • DNS Hijack
  • Docker 容器内实现系统级代理
docker run -d \
  --name clash \
  --restart unless-stopped \
  --cap-add NET_ADMIN \
  --device /dev/net/tun:/dev/net/tun \
  -p 7890:7890 \
  -p 3128:3128 \
  -p 7891:7891 \
  -p 9090:9090 \
  -p 53:53/tcp \
  -p 53:53/udp \
  superxiao666/clash2:latest

⁠Host 网络 + TUN(性能最好)

docker run -d \
  --name clash \
  --restart unless-stopped \
  --network host \
  --cap-add NET_ADMIN \
  --device /dev/net/tun:/dev/net/tun \
  -v /opt/clash:/etc/clash \
  superxiao666/clash2:latest

⁠优点:

  • 不需要映射端口
  • TUN、DNS 劫持最稳定
  • Fake-IP 兼容性最好

⁠缺点:

  • 容器直接使用宿主机网络

⁠Docker Compose

⁠不带 TUN

services:
  clash:
    image: superxiao666/clash2:latest
    container_name: clash
    restart: unless-stopped
    ports:
      - "7890:7890"
      - "3128:3128"
      - "7891:7891"
      - "9090:9090"
      - "53:53/tcp"
      - "53:53/udp"
    volumes:
      - ./clash:/etc/clash

⁠带 TUN

services:
  clash:
    image: superxiao666/clash2:latest
    container_name: clash
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - "7890:7890"
      - "3128:3128"
      - "7891:7891"
      - "9090:9090"
      - "53:53/tcp"
      - "53:53/udp"
    volumes:
      - ./clash:/etc/clash

Tag summary

Content type

Image

Digest

sha256:396e1c2c1…

Size

42.3 MB

Last updated

3 months ago

docker pull superxiao666/clash2