Giter Club home page Giter Club logo

clash-tproxy's Introduction

clash-tproxy

使用 Docker 和 clash 容器进行透明代理

特点

  • IPv4 TCP 透明代理
  • IPv4 UDP 透明代理
  • FULL CONE NAT

使用方法

docker

  1. 开启混杂模式

    ip a # 查看你的网卡名字,Openwrt一般是br-lan
    ip link set <你的网卡名> promisc on
  2. Docker 创建 macvlan 网络

    docker network create -d macvlan --subnet=<局域网的CIDR地址块> --gateway=<局域网的网关> -o parent=<网卡名> <macvlan网络名>
  3. 编写好 clash 的配置文件,必须将 Tproxy 端口设置为 7893, DNS端口设置为 53

  4. 运行容器

    docker run --name clash -d -v /your/path/config.yaml:/root/.config/clash/config.yaml  --network <macvlan网络名> --ip <容器IP地址> --cap-add=NET_ADMIN feikeke/clash-tproxy
  5. 将手机/电脑等客户端,网关和DNS设置为容器 IP

Docker Compose

  1. 确保你的 docker-compose 版本是 1.27 以上

  2. 下载 docker-compose.yml

    wget https://raw.githubusercontent.com/fei-ke/clash-tproxy/master/docker-compose.yml
  3. 修改参数

  4. 执行命令以启动容器

    docker-compose up -d

clash-tproxy's People

Contributors

fei-ke avatar yi-z0 avatar wsk3373 avatar beermedlar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.