Skip to content

Commit

Permalink
add action TEE to prerouting mangle descr
Browse files Browse the repository at this point in the history
  • Loading branch information
zersh01 committed Jan 16, 2024
1 parent bea37d4 commit 6781c5d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Iptables/en/prerouting-mangle-descr
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,17 @@ In addition, fully transparent proxying is transparent from the point of view of
calls from a certain subnet of clients to servers from another subnet, you can make it so that not only clients think that they are accessing servers directly,
but the servers also "saw" the real source addresses of the clients and could establish reverse connections with them (for example, in the case of active FTP mode).
With traditional "transparent" proxying, servers can only see the proxy server address.</ul>

<ul><strong>TEE</strong> - this is an option in iptables that is used to copy packets from one interface to another.
It is applied in the PREROUTING and POSTROUTING chains in the mangle table.<br><br>

When you use -j TEE, you also need to specify the IP address of the target node using the --gateway option.
All packets passing through the chain where this rule is applied will be copied and sent to the specified gateway,
but the original packet will still be sent in its original direction. <br><br>

This is useful, for example, when you want to analyze traffic in real time without interrupting its transmission.

<code>
iptables -t mangle -A PREROUTING -j TEE --gateway 10.0.0.1<br>
iptables -t mangle -A POSTROUTING -j TEE --gateway 10.0.0.1
</code></ul>
11 changes: 11 additions & 0 deletions Iptables/ru/prerouting-mangle-descr
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,14 @@ Normal-Service (TOS 0, специальные требования отсутс
обращений некоторой подсети клиентов к серверам из другой подсети, можно сделать так, чтобы не только клиенты считали, что обращаются напрямую к серверам,
но и сервера «видели» настоящие исходные адреса клиентов и могли бы устанавливать с ними обратные соединения (например, в случае активного режима FTP).
При традиционном же «прозрачном» проксировании, сервера могут видеть только адрес прокси-сервера.</ul>

<ul><strong>TEE</strong> - это опция в iptables, которая используется для копирования пакетов из одного интерфейса в другой. Применяется в
цепочках PREROUTING и POSTROUTING в таблице mangle.<br><br>
Когда вы используете -j TEE, вы также должны указать IP-адрес целевого узла с помощью опции --gateway. Все пакеты,
проходящие через цепочку, где применяется это правило, будут скопированы и отправлены на указанный шлюз, но оригинальный пакет
все равно будет передан в его исходном направлении. Это полезно, например, когда вы хотите анализировать трафик в реальном времени, не прерывая его передачу.<br><br>

<code>
iptables -t mangle -A PREROUTING -j TEE --gateway 10.0.0.1<br>
iptables -t mangle -A POSTROUTING -j TEE --gateway 10.0.0.1
</code></ul>

0 comments on commit 6781c5d

Please sign in to comment.