Score:0

Why redidrect works with output hook but not with prerouting hook

pk flag

I'm playing around with nftables to gain more experience and have a pretty easy scenario: NAT the destination port 8080 to 8081 (not really useful but in the Lab it is good enough).

This nft config works (so all packets which are targeted at port 8080 are forwarded to port 8081):

chain foo {
        type nat hook output priority mangle; policy accept;
        tcp dport 8080 redirect to :8081
}

when I change the base chain hook from output to prerouting:

chain foo {
        type nat hook prerouting priority mangle; policy accept;
        tcp dport 8080 redirect to :8081
}

it doesn't work any more.

Why does the prerouting hook is not working in this scenario?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.