mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2026-04-23 00:07:30 +08:00
Chore: move to wiki
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
version: '2.4'
|
||||
|
||||
services:
|
||||
tun2socks:
|
||||
image: ghcr.io/xjasonlyu/tun2socks:latest
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
devices:
|
||||
- '/dev/net/tun:/dev/net/tun'
|
||||
environment:
|
||||
- GODEBUG=madvdontneed=1
|
||||
- LOGLEVEL=
|
||||
- TUN=
|
||||
- TUN_ADDR=
|
||||
- PROXY=
|
||||
- STATS=
|
||||
- TOKEN=
|
||||
- MTU=
|
||||
- EXTRA_COMMANDS=
|
||||
- TUN_INCLUDED_ROUTES=
|
||||
- TUN_EXCLUDED_ROUTES=
|
||||
networks:
|
||||
switch:
|
||||
ipv4_address: 172.20.1.2
|
||||
sysctls:
|
||||
- net.ipv4.ip_forward=1
|
||||
- net.ipv4.conf.all.rp_filter=0
|
||||
restart: unless-stopped
|
||||
container_name: tun2socks
|
||||
|
||||
networks:
|
||||
switch:
|
||||
name: switch
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
- subnet: '172.20.1.0/25'
|
||||
gateway: 172.20.1.1
|
||||
driver: macvlan
|
||||
driver_opts:
|
||||
parent: eth0
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Create the necessary file structure for /dev/net/tun
|
||||
if [ ! -c /dev/net/tun ]; then
|
||||
if [ ! -d /dev/net ]; then
|
||||
mkdir -m 755 /dev/net
|
||||
fi
|
||||
mknod /dev/net/tun c 10 200
|
||||
chmod 0755 /dev/net/tun
|
||||
fi
|
||||
|
||||
# Load the tun module if not already loaded
|
||||
if ( ! (lsmod | grep -q "^tun\s")); then
|
||||
insmod /lib/modules/tun.ko
|
||||
fi
|
||||
Reference in New Issue
Block a user