I know linux has 3 built-in tables and each of them has its own chains as follow:
FILTER: PREROUTING, FORWARD, POSTROUTING
NAT: PREROUTING, INPUT, OUTPUT, POSTROUTING
MANGLE: PREROUTING, INPUT, FORWARD, OUTPUT, POSTROUTING
But I can't understand how they are traversed, in which order, if there is. For example, how are they traversed when:
- I send a packet to a pc in my same local network
- when I send a packet to a pc in a different network
- when a gateway receives a packet and it has to forward it
- when I receive a packet destinated to me
- any other case (if any)