Инструменты пользователя

Инструменты сайта


x

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слеваПредыдущая версия
Следующая версия
Предыдущая версия
x [20.07.2025 07:29] auginx [20.07.2025 07:44] (текущий) – [Examples for transparent proxy] augin
Строка 90: Строка 90:
 Add a dokodemo-door inbound as below. Add a dokodemo-door inbound as below.
  
 +<code | download>
 { {
   "network": "tcp,udp",   "network": "tcp,udp",
Строка 95: Строка 96:
   "followRedirect": true   "followRedirect": true
 } }
 +</code>
 Configure iptables as below. Configure iptables as below.
  
-Create new chain+<code bash> 
 +Создаём новую цепь
 iptables -t nat -N V2RAY iptables -t nat -N V2RAY
 iptables -t mangle -N V2RAY iptables -t mangle -N V2RAY
 iptables -t mangle -N V2RAY_MARK iptables -t mangle -N V2RAY_MARK
  
-Ignore your V2Ray server's addresses +Игнорируем адреса серверов V2Ray 
-It's very IMPORTANTjust be careful.+Это ОЧЕНЬ ВАЖНОбудьте внимательны.
 iptables -t nat -A V2RAY -d 123.123.123.123 -j RETURN iptables -t nat -A V2RAY -d 123.123.123.123 -j RETURN
  
-Ignore LANs and any other addresses you'd like to bypass the proxy +Игнорируем адреса локальной сети и любые другие адреса, 
-See Wikipedia and RFC5735 for full list of reserved networks.+которые не требуется пропускать через прокси-сервер 
 +# См. Википедию и RFC5735 для полного списка зарезервированных сетей.
 iptables -t nat -A V2RAY -d 0.0.0.0/8 -j RETURN iptables -t nat -A V2RAY -d 0.0.0.0/8 -j RETURN
 iptables -t nat -A V2RAY -d 10.0.0.0/8 -j RETURN iptables -t nat -A V2RAY -d 10.0.0.0/8 -j RETURN
Строка 117: Строка 121:
 iptables -t nat -A V2RAY -d 240.0.0.0/4 -j RETURN iptables -t nat -A V2RAY -d 240.0.0.0/4 -j RETURN
  
-Anything else should be redirected to Dokodemo-door's local port+Всё остальное перенаправляем на локальный порт Dokodemo-door
 iptables -t nat -A V2RAY -p tcp -j REDIRECT --to-ports 12345 iptables -t nat -A V2RAY -p tcp -j REDIRECT --to-ports 12345
  
-Add any UDP rules+Добавляем правила для UDP
 ip route add local default dev lo table 100 ip route add local default dev lo table 100
 ip rule add fwmark 1 lookup 100 ip rule add fwmark 1 lookup 100
Строка 126: Строка 130:
 iptables -t mangle -A V2RAY_MARK -p udp --dport 53 -j MARK --set-mark 1 iptables -t mangle -A V2RAY_MARK -p udp --dport 53 -j MARK --set-mark 1
  
-Apply the rules+Применяем правила
 iptables -t nat -A OUTPUT -p tcp -j V2RAY iptables -t nat -A OUTPUT -p tcp -j V2RAY
 iptables -t mangle -A PREROUTING -j V2RAY iptables -t mangle -A PREROUTING -j V2RAY
-iptables -t mangle -A OUTPUT -j V2RAY_MARK+iptables -t mangle -A OUTPUT -j V2RAY_MARK</code>
x.1752996578.txt.gz · Последнее изменение: augin