@
@
@coddoc2021-06-01 16:47:54
iptables
@coddoc, 2021-06-01 16:47:54

Tracing in IPTables?

Good day to ALL!

Let's say we have a raw table like this:

*raw
-P PREROUTING ACCEPT
-P OUTPUT ACCEPT
-A PREROUTING -i eth0 -s xxxx/32 -p tcp -m tcp --dport 12345 -j TRACE
-A OUTPUT -o eth0 -d xxxx /32 -p tcp -m tcp --sport 12345 -j TRACE
COMMIT

What does the "policy:2" in the "TRACE: raw:PREROUTING:policy:2" prefix mean?

Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hint000, 2021-06-01
_

https://gist.github.com/egernst/2c39c6125d916f8caa...

Note: If the matching rule number (3 for prerouting chain of raw table) is greater than the number of rules there, it means there wasn't a match for any of the rules and it is just returning to whomever called the chain.

https://stackoverflow.com/questions/41748330/how-t...
came to this question too and dit some testing: policy:5 seem to refer to the fictitious last "rule" of your chain, where the policy is considered. so loonyuni's traced chain should have 4 explicit rules in it.

In other words, policy means that policy (the default rule for the chain) worked.
And policy:2 only means that there was one rule in the chain and policy turned out to be the last and second. If there were four rules in the chain, policy:5 would appear somewhere in the log.

C
coddoc, 2021-06-02
@coddoc

Thank you. Of course, the purpose of TRACE is not terminating, the packet leaves the table according to the policy.
Even uncomfortable that so blunted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question