Skip to content

max619/tun-xray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tun-xray

Very simple set of scripts to use xray socks5 proxy as tun adapter and redirect all requests to specific ip list via socks5 proxy on router level.

I'm using it on Ubiquiti and OpenWRT routers, but i think it should work on any linux based platform with systemd/procd.

Installation

To download binaries run:

./install.sh <xray arch> <tun2socks arch>

ex:

./install.sh mips32 mips-hardfloat

Client

Create file 'tun-xray/iplist.txt' and add list of ips to pass through xray

You can specify both subnets and specific ips:

220.181.174.0/24
220.181.174.32

Put Xray config into tun-xray/xray_config.client.json

Then copy the tun-xray directory to the router or device on which you want to run the proxy

scp -r tun-xray user@192.168.0.1:/opt/tun-xray

Create symlinks for systemd services

ln -s /opt/tun-xray/xray.service /etc/systemd/system/xray.service
ln -s /opt/tun-xray/tun2socks.service /etc/systemd/system/tun2socks.service

Or for proc.d on OpenWRT

ln -s /opt/tun-xray/xray.init /etc/init.d/xray
ln -s /opt/tun-xray/tun2socks.init /etc/init.d/tun2socks

Create users

useradd xray
useradd tun2socks

Start services

systemctl start xray
systemctl start tun2socks

Or

/etc/init.d/xray start
/etc/init.d/tun2socks start

Server

Put Xray config into tun-xray/xray_config.server.json

Then copy the tun-xray directory to the router or device on which you want to run the server

scp -r tun-xray user@192.168.0.1:/opt/tun-xray

Create symlinks for systemd services

ln -s /opt/tun-xray/xray-server.service /etc/systemd/system/xray-server.service

Create user and update acess rights

useradd xray
chown -R xray:xray /opt/tun-xray

Used projects

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages