Skip to content

How do iptables rules work and not create routing loops #5402

Answered by cpretzer
AlexHockey asked this question in Q&A
Discussion options

You must be logged in to vote

@AlexHockey thanks for the question, I'm also not fluent in iptables rules, but I think I know what's going on here and if I'm wrong, someone else may be able to chime in.

In the PROXY_INIT_OUTPUT chain, the proxy user 2102 is ignored, with this rule:
-A PROXY_INIT_OUTPUT -m owner --uid-owner 2102 -m comment --comment "proxy-init/ignore-proxy-user-id/1607688012" -j RETURN

So, in the scenario you mention, the proxy has accepted the packet and will send a the request to the underlying service as the proxy user 2102, in which case, the jump to RETURN prevents the loop that you've described.

I think that's what's happening after looking through the rules in your post.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@AlexHockey
Comment options

@adleong
Comment options

@AlexHockey
Comment options

@cpretzer
Comment options

Answer selected by adleong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants