/etc/sysctl.conf
net.ipv4.ip_forward=1
/etc/sing-box/config.json
{
"log": {
"level": "error"
},
"inbounds": [
{
"tag": "0",
"type": "tun",
"interface_name": "tun0",
"inet4_address": "172.19.0.1/30"
},
{
"tag": "1",
"type": "tun",
"interface_name": "tun1",
"inet4_address": "172.19.0.5/30"
},
{
"tag": "2",
"type": "tun",
"interface_name": "tun2",
"inet4_address": "172.19.0.9/30"
},
{
"tag": "3",
"type": "tun",
"interface_name": "tun3",
"inet4_address": "172.19.0.13/30"
},
{
"tag": "4",
"type": "tun",
"interface_name": "tun4",
"inet4_address": "172.19.0.17/30"
},
{
"tag": "5",
"type": "tun",
"interface_name": "tun5",
"inet4_address": "172.19.0.21/30"
},
{
"tag": "6",
"type": "tun",
"interface_name": "tun6",
"inet4_address": "172.19.0.25/30"
},
{
"tag": "7",
"type": "tun",
"interface_name": "tun7",
"inet4_address": "172.19.0.29/30"
},
{
"tag": "8",
"type": "tun",
"interface_name": "tun8",
"inet4_address": "172.19.0.33/30"
},
{
"tag": "9",
"type": "tun",
"interface_name": "tun9",
"inet4_address": "172.19.0.37/30"
},
{
"tag": "10",
"type": "tun",
"interface_name": "tun10",
"inet4_address": "172.19.0.41/30"
},
{
"tag": "11",
"type": "tun",
"interface_name": "tun11",
"inet4_address": "172.19.0.45/30"
},
{
"tag": "12",
"type": "tun",
"interface_name": "tun12",
"inet4_address": "172.19.0.49/30"
},
{
"tag": "13",
"type": "tun",
"interface_name": "tun13",
"inet4_address": "172.19.0.53/30"
},
{
"tag": "14",
"type": "tun",
"interface_name": "tun14",
"inet4_address": "172.19.0.57/30"
}
],
"outbounds": [
{
"tag": "0",
"type": "socks",
"server": "123.123.123.3",
"server_port": 2000,
"version": "5",
"username": "uepvpt",
"password": "a2coa2"
},
{
"tag": "1",
"type": "socks",
"server": "123.123.123.4",
"server_port": 2001,
"version": "5",
"username": "ozohof",
"password": "qli7wz"
},
{
"tag": "2",
"type": "socks",
"server": "123.123.123.5",
"server_port": 2002,
"version": "5",
"username": "skpywm",
"password": "3hlsqs"
},
{
"tag": "3",
"type": "socks",
"server": "123.123.123.6",
"server_port": 2003,
"version": "5",
"username": "jobsms",
"password": "hmg5gv"
},
{
"tag": "4",
"type": "socks",
"server": "123.123.123.7",
"server_port": 2004,
"version": "5",
"username": "yladrt",
"password": "ayig4g"
},
{
"tag": "5",
"type": "socks",
"server": "123.123.123.8",
"server_port": 2005,
"version": "5",
"username": "cyukxl",
"password": "81oma1"
},
{
"tag": "6",
"type": "socks",
"server": "123.123.123.9",
"server_port": 2006,
"version": "5",
"username": "tenahb",
"password": "hr7mxu"
},
{
"tag": "7",
"type": "socks",
"server": "123.123.123.10",
"server_port": 2007,
"version": "5",
"username": "zuqbd",
"password": "sb4fg"
},
{
"tag": "8",
"type": "socks",
"server": "123.123.123.11",
"server_port": 2008,
"version": "5",
"username": "xyown",
"password": "bu8lw"
},
{
"tag": "9",
"type": "socks",
"server": "123.123.123.12",
"server_port": 2009,
"version": "5",
"username": "qlhlv",
"password": "332jp"
},
{
"tag": "10",
"type": "socks",
"server": "123.123.123.227",
"server_port": 7777,
"version": "5",
"username": "test",
"password": "test"
},
{
"tag": "11",
"type": "socks",
"server": "123.123.123.219",
"server_port": 7777,
"version": "5",
"username": "test",
"password": "test"
},
{
"tag": "12",
"type": "socks",
"server": "123.123.123.210",
"server_port": 7777,
"version": "5",
"username": "test",
"password": "test"
},
{
"tag": "13",
"type": "socks",
"server": "123.123.123.213",
"server_port": 7777,
"version": "5",
"username": "test",
"password": "test"
},
{
"tag": "14",
"type": "socks",
"server": "123.123.123.197",
"server_port": 7777,
"version": "5",
"username": "test",
"password": "test"
}
],
"route": {
"rules": [
{
"inbound": "0",
"outbound": "0"
},
{
"inbound": "1",
"outbound": "1"
},
{
"inbound": "2",
"outbound": "2"
},
{
"inbound": "3",
"outbound": "3"
},
{
"inbound": "4",
"outbound": "4"
},
{
"inbound": "5",
"outbound": "5"
},
{
"inbound": "6",
"outbound": "6"
},
{
"inbound": "7",
"outbound": "7"
},
{
"inbound": "8",
"outbound": "8"
},
{
"inbound": "9",
"outbound": "9"
},
{
"inbound": "10",
"outbound": "10"
},
{
"inbound": "11",
"outbound": "11"
},
{
"inbound": "12",
"outbound": "12"
},
{
"inbound": "13",
"outbound": "13"
},
{
"inbound": "14",
"outbound": "14"
}
]
}
}
/bin/ip-rule
#!/bin/sh
ip rule flush
ip rule add table main prio 10
ip rule add from 192.168.0.0/16 table 2 prio 10000
ip rule add from default table default prio 32767
ip rule add from 192.168.1.9 table 1 prio 100
ip rule add from 192.168.1.91 table 101 prio 100
ip rule add from 192.168.1.100 table 100 prio 1000
ip rule add from 192.168.1.101 table 101 prio 1000
ip rule add from 192.168.1.102 table 102 prio 1000
ip rule add from 192.168.1.103 table 103 prio 1000
ip rule add from 192.168.1.104 table 104 prio 1000
ip rule add from 192.168.1.105 table 105 prio 1000
ip rule add from 192.168.1.106 table 106 prio 1000
ip rule add from 192.168.1.107 table 107 prio 1000
ip rule add from 192.168.1.108 table 108 prio 1000
ip rule add from 192.168.1.109 table 109 prio 1000
ip rule add from 192.168.1.110 table 110 prio 1000
ip rule add from 192.168.1.111 table 111 prio 1000
ip rule add from 192.168.1.112 table 112 prio 1000
ip rule add from 192.168.1.113 table 113 prio 1000
ip rule add from 192.168.1.114 table 114 prio 1000
ip rule add from 192.168.1.115 table 100 prio 1000
/bin/ip-route
#!/bin/sh
/bin/ip route replace 1.1.1.1 via 192.168.1.1
/bin/ip route replace 8.8.8.8 via 192.168.1.1
/bin/ip route replace default via 192.168.1.1 table 1
/bin/ip route replace default via 192.168.1.2 table 2
/bin/ip route replace default via 192.168.1.1 table default
/bin/ip route replace default dev tun0 table 100
/bin/ip route replace default dev tun1 table 101
/bin/ip route replace default dev tun2 table 102
/bin/ip route replace default dev tun3 table 103
/bin/ip route replace default dev tun4 table 104
/bin/ip route replace default dev tun5 table 105
/bin/ip route replace default dev tun6 table 106
/bin/ip route replace default dev tun7 table 107
/bin/ip route replace default dev tun8 table 108
/bin/ip route replace default dev tun9 table 109
/bin/ip route replace default dev tun10 table 110
/bin/ip route replace default dev tun11 table 111
/bin/ip route replace default dev tun12 table 112
/bin/ip route replace default dev tun13 table 113
/bin/ip route replace default dev tun14 table 114
/etc/rc.local
#!/bin/sh
/bin/ip-rule
/bin/ip-route
sleep 3
/bin/ip-route
sleep 3
/bin/ip-route
sleep 3
/bin/ip-route
exit 0
标签:box,bin,ip,server,socks5,tag,转爱快,table,type
From: https://www.cnblogs.com/xiangxisheng/p/18012030