All Projects → danielfree → asus-v2ray-transparent-proxy

danielfree / asus-v2ray-transparent-proxy

Licence: Unlicense License
transparent proxy with v2ray, iptables, ipset 无线路由器 v2ray 透明代理

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to asus-v2ray-transparent-proxy

TutoAsus
Tutorial on how to setup a nginx reverse proxy on Asus router with Merlin firmware, and get Let's Encrypt certificate with acme.sh.
Stars: ✭ 35 (-35.19%)
Mutual labels:  asuswrt-merlin, asus-routers
Asuswrt Merlin
Asuswrt-Merlin is an enhanced version of Asuswrt, the firmware used by Asus's modern routers.
Stars: ✭ 6,591 (+12105.56%)
Mutual labels:  asuswrt-merlin, asus-routers
v2hreo
Swift 联动 CGO 开发的 V2ray MacOS 菜单栏应用 ⚡️
Stars: ✭ 18 (-66.67%)
Mutual labels:  v2ray
get subscribe
✈️ 免费机场 / 免费VPN -> 自动获取免 clash/v2ray/trojan/sr/ssr 订阅链接,间隔12小时持续更新 | 科学上网 | 翻墙
Stars: ✭ 1,512 (+2700%)
Mutual labels:  v2ray
c2ray step by step
一步一步教你安装 c2ray 服务端(caddy+v2ray)
Stars: ✭ 13 (-75.93%)
Mutual labels:  v2ray
VPN
Personal vpn using v2ray and shadowsocks hosted on heroku
Stars: ✭ 154 (+185.19%)
Mutual labels:  v2ray
v2ray
每日分享免费节点、免费机场、ssr节点、v2ray节点、v2ray订阅、clash节点、clash订阅、shadowrocket订阅、Quantumult X订阅、Clash .NET订阅、小火箭节点、小猫咪节点、免费翻墙、免费科学上网、免费梯子、免费trojan节点、蓝灯、谷歌商店、翻墙梯子、安卓VPN、iphone翻墙节点、iphone vpn、一键翻墙浏览器、节点分享、免费SSR、蓝灯、谷歌商店、V2ary免费节点、代理、proxy代理科学上网、TG代理、电报代理、Telegram代理、ip加速、翻墙软件、socks5、破解VPN、机场推荐、节点订阅、破解VPN
Stars: ✭ 525 (+872.22%)
Mutual labels:  v2ray
auto-v2ray-ssr
VPS上一键部署SSR、v2ray、trojan、bbr脚本,还提供客户端。
Stars: ✭ 17 (-68.52%)
Mutual labels:  v2ray
geoip
🌚 🌍 🌝 GeoIP 规则文件加强版,同时支持定制 V2Ray dat 格式路由规则文件 geoip.dat 和 MaxMind mmdb 格式文件 Country.mmdb。Enhanced edition of GeoIP files for V2Ray, Xray-core, Trojan-Go, Clash and Leaf, with replaced CN IPv4 CIDR available from ipip.net, appended CIDR lists and more.
Stars: ✭ 524 (+870.37%)
Mutual labels:  v2ray
v2rayfree
免费公益v2ray节点订阅、最新免费v2ray节点订阅地址、免费v2ray节点每日更新、免费ss/v2ray/trojan节点、freefq
Stars: ✭ 352 (+551.85%)
Mutual labels:  v2ray
mieru
見える是一款 socks5 网络代理(科学上网)工具。Mieru is a socks5 proxy to bypass censorship.
Stars: ✭ 63 (+16.67%)
Mutual labels:  v2ray
xray-node
Python 开发的基于 xray-core 的多用户代理后端,支持用户动态管理和流量统计。
Stars: ✭ 20 (-62.96%)
Mutual labels:  v2ray
docker-v2ray
A docker-compose deployment for v2ray + WebSocket + TLS setup.
Stars: ✭ 30 (-44.44%)
Mutual labels:  v2ray
V2RayGeoKit
No description or website provided.
Stars: ✭ 26 (-51.85%)
Mutual labels:  v2ray
v2rock
V2ray GUI client for Ubuntu and Debian
Stars: ✭ 60 (+11.11%)
Mutual labels:  v2ray
v2ray-nodes
v2ray,shadowrocket节点
Stars: ✭ 691 (+1179.63%)
Mutual labels:  v2ray
overthefirewall
覆盖全平台完全免费节点订阅机场推荐破解VPN软件分享
Stars: ✭ 1,042 (+1829.63%)
Mutual labels:  v2ray
free
freefq账号已恢复,此号暂停使用!--翻墙、免费翻墙、免费科学上网、免费节点、免费梯子、免费ss/v2ray/trojan节点、蓝灯、谷歌商店、翻墙梯子
Stars: ✭ 280 (+418.52%)
Mutual labels:  v2ray
v2scar
sidecar for V2ray
Stars: ✭ 104 (+92.59%)
Mutual labels:  v2ray
dockerfile
A collection of dockerfile I use
Stars: ✭ 90 (+66.67%)
Mutual labels:  v2ray

asus-v2ray-transparent-proxy

Transparent proxy on WiFi router with v2ray+dnsmasq+ipset. Tested on Asus RT-68U Merlin firmware (384.4_2).

note:

v2ray v2.45 is the latest tested version, v2.46+ has included geoip.dat which causes v2ray to crash at start on router because of 'out of memory'. It's related to Golang's virtual memory management. If you want to use newer version of v2ray, you may try add some swap with usb.

Internal Details

  1. Chinese domain whitelist mode. We use dnsmasq-china-list from @felixonmars and add to ipset white_list rules, so only domains in this list will be resolved via 119.29.29.29, everything else will be resolved via 202.141.162.123 (USTC LUG anti-pollution DNS).

  2. Setup iptables to use ipset for direct connect and redirect everything else to local v2ray transparent proxy port.

  3. Start v2ray on router opening one port: 1080 as transparent proxy. Requests from 1080 will be forwarded as defined in v2ray config.

  4. start-all.sh script adds a cron job that check the v2ray process every 5 mins, since v2ray process often crashes when testing on my router.

Usage

Requirements: Asus Merlin firmware, jffs enabled, ssh connection, a working v2ray server

  1. Download v2ray-linux-arm.zip from v2ray release page and unzip to /jffs/v2ray/ via ssh

  2. Clone this repo, cp everything to /jffs/ via ssh

  3. On router: modify /jffs/config.json according to your proxy server and cp to /jffs/v2ray/config.json

  4. On router: modify /jffs/nat-start.sh, change "YOUR_SERVER_IP" to your proxy server's ip

  5. On router: run sh /jffs/dnsmasq.sh && sh /jffs/start-all.sh to setup dnsmasq/v2ray and start service

  6. If everything goes well, connect to your WiFi and enjoy

  7. If you want to enable this after router reboot, add /jffs/start-all.sh in nat-start script, on router run echo 'sh /jffs/start-all.sh' >> /jffs/scripts/nat-start

asus-v2ray-transparent-proxy

无线路由器上跑的透明代理,使用 v2ray+dnsmasq+ipset。 在 RT-68U Merlin (384.4_2) 固件上测试通过。

注意:

v2ray v2.45 版本是测试可运行的最高版本, v2.46 以上的版本增加了 geoip.dat 会使 v2ray 在启动时出错崩溃,错误是 'out of memory'. 这个跟 Golang 的虚拟内存管理有关. 如果想使用最新版本的 v2ray, 可以尝试用 U 盘给路由器增加点 Swap 内存.

工作原理

  1. 国内域名白名单模式,使用 @felixonmars 的 dnsmasq-china-list 加入 ipset rules 白名单,名单内的域名将使用 119.29.29.29 来解析,剩下全部交给中科大防污染 DNS 202.141.162.123 解析。

  2. 使用 iptables 做分流,ipset rule 中的直接访问,剩下的流量全部走 v2ray 本地透明代理端口。

  3. 启动 v2ray 开放一个端口:1080 透明代理,由 v2ray 的配置程序指定所有发往 1080 端口的数据自动转发。

  4. start-all.sh 脚本中安装了一个定时任务,每隔5分钟检查一次 v2ray 进程,因为测试时发现 v2ray 进程在路由器上会经常性的崩溃退出。

使用方法

前提要求:Asus 梅林固件,启用了 jffs 和 ssh, 以及一个可用的 v2ray 远程服务器

  1. v2ray release page 下载 v2ray-linux-arm.zip, 解压缩后通过 ssh 上传至 /jffs/v2ray/ 目录

  2. 下载本 repo 中的所有文件到本地,通过 ssh 上传至 /jffs 目录

  3. 在路由器上修改 /jffs/config.json 将其中远程代理服务器替换为你自己使用的设置,复制到 /jffs/v2ray/config.json

  4. 在路由器上修改 /jffs/nat-start.sh, 将 "YOUR_SERVER_IP" 修改为你的远程 v2ray 服务器 ip

  5. 在路由器上运行 sh /jffs/dnsmasq.sh && sh /jffs/start-all.sh 来配置 dnsmasq/v2ray 并启动相关服务

  6. 如果一切顺利,连上你的 WiFi 即可

  7. 如果想在重启路由器后可以自动启动,可以将 /jffs/start-all.sh 加入 nat-start 脚本,在路由器上运行 echo 'sh /jffs/start-all.sh' >> /jffs/scripts/nat-start

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].