x
Различия
Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слеваПредыдущая версияСледующая версия | Предыдущая версия | ||
x [20.07.2025 07:30] – augin | x [20.07.2025 07:44] (текущий) – [Examples for transparent proxy] augin | ||
---|---|---|---|
Строка 99: | Строка 99: | ||
Configure iptables as below. | Configure iptables as below. | ||
- | <code bash># | + | <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' | + | # Игнорируем адреса серверов |
- | # It's very IMPORTANT, just 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 | + | # которые не требуется пропускать через прокси-сервер |
+ | # См. Википедию и 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 | ||
Строка 119: | Строка 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 | + | # Всё остальное перенаправляем на локальный порт |
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 | + | # Добавляем правила для |
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 | ||
Строка 128: | Строка 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</ |
x.1752996609.txt.gz · Последнее изменение: — augin