I am new to nftables. I have read a few docs and went through the main wiki page and I still don't understand how the DOCKER-USER chain work.
Here is the table which was created by docker:
table ip filter {
chain DOCKER {
}
chain DOCKER-ISOLATION-STAGE-1 {
iifname "docker0" oifname != "docker0" counter packets 0 bytes 0 jump DOCKER-ISOLATION-STAGE-2
counter packets 0 bytes 0 return
}
chain DOCKER-ISOLATION-STAGE-2 {
oifname "docker0" counter packets 0 bytes 0 drop
counter packets 0 bytes 0 return
}
chain FORWARD {
type filter hook forward priority filter; policy drop;
counter packets 15050 bytes 1456483 jump DOCKER-USER
counter packets 0 bytes 0 jump DOCKER-ISOLATION-STAGE-1
oifname "docker0" ct state related,established counter packets 0 bytes 0 accept
oifname "docker0" counter packets 0 bytes 0 jump DOCKER
iifname "docker0" oifname != "docker0" counter packets 0 bytes 0 accept
iifname "docker0" oifname "docker0" counter packets 0 bytes 0 accept
}
chain DOCKER-USER {
iifname "pub_br0" oifname "pub_br0" counter packets 15050 bytes 1456483 accept
counter packets 0 bytes 0 return
}
}
As you can see, the default policy of the FORWARD chain is "drop". Since my server does route to VMs as well, I had to insert a rule as the official doc said.
So the first line in DOCKER-USER was created by me.
The question is: Why does it work ? I read in the wiki page that "jump"ing to chain means that the control will return back to the caller chain, where my packet should have been dropped by the default policy.
What did I miss, why was my packet from pub_br0 to pub_br0 not dropped in docker's FORWARD chain?
Thanks