A simple gui for tun2socks on Windows.
Cooperating with clients such as v2ray and ss (eg. v2rayN), it can realize tun mode.
By configuring config.yaml and running TunMax, you can easily enable the tun device to take over all TCP/UDP
traffic of the machine, so that applications such as games and UWP that cannot be proxied by the system can also be proxied, realizing a true global proxy mode.
# 与Tun设备出口对接的代理地址,支持:socks5、shadowsocks
# 示例:socks5://127.0.0.1:10808、ss://chacha20:[email protected]:1080
# 注意:如果以下是本机监听的地址,开启这个监听地址的软件一定要使用全局规则(Global Mode),否则会引起死循环。关于死循环的解释,参见本项目的README.md
Proxy : socks5://127.0.0.1:10808
# 可选两种模式,full与expert
# full模式:默认模式,除Server项目设置的地址和本地局域网ip直连,其他流量均走tun
# expert模式:除ExpertIP设置的地址走tun,其他流量均直连。
Mode : full
# 实际代理服务器的域名或IP,可以填写多个,如为域名程序会自动解析其IP地址。
# 该项也用于添加路由表直连规则,属于以下域名或IP的流量均直连,不经过tun。
Server :
- yourserver.com
- 104.67.88.90
# 使用expert模式时生效
ExpertIP :
- ip138.com
- 192.168.1.26
# [可选功能]
# 因为full模式下,本地局域网ip默认会直连。如需使其强制走tun,将以下enable值改为true,并填写强制走tun的局域网ip。
# 开启以下配置后,无论是full模式还是expert模式,填写的局域网ip都会走tun。注:以下仅可填写ip,不支持填写域名。
ProxyLanIP :
enable : false
IP :
- 192.168.1.10
- 192.168.1.11
After tun is turned on, except for the IP set in Server
item in config.yaml
and the IP segment of the local LAN, TCP/UDP
connections of all other IPs will be taken over by the tun device.
When using, you should pay attention to the following settings, otherwise it will cause an infinite connection loop and the web page cannot be opened.
Reason: Take using TunMax with v2rayN to implement tun mode as an example. After tun is turned on, tun takes over all* TCP/UDP
connections of the machine. If the baidu.com direct connection rule is set in v2rayN, the browser accesses baidu.com and initiates a connection to baidu.com. The connection is intercepted and taken over by tun, and tun sends it to v2rayN for processing. v2rayN initiates a connection to baidu.com according to the rules. Direct connection, this direct connection will be intercepted and taken over by tun, and tun will send the connection to v2rayN, and v2rayN will initiate a direct connection, causing an infinite loop.
All *: excluding the IP set in the Server
item in config.yaml
and the IP segment of the local LAN.
Reason: tun has taken over all* TCP/UDP
connections of the local machine, including UDP traffic for DNS queries. If the local proxy software and remote server do not enable UDP support, UDP traffic forwarding cannot be completed to complete DNS queries, and the domain name cannot be resolved to IP. As a result, the web page cannot be opened.
All *: excluding the IP set in the Server
item in config.yaml
and the IP segment of the local LAN.
Tips: The v2rayN client has UDP support enabled by default and no special settings are required. The proxies for vmess and vless protocols enable UDP support by default and do not require special settings.
Windows 7, 8, 10, 11
xjasonlu/tun2socks tun2socks - powered by gVisor TCP/IP stack
WireGuard/wintun wintun - TUN Device Driver for Windows