fix: scope VPC SNAT rule to exclude locally-generated packets (#13942) - #13943
Open
waterWang wants to merge 1 commit into
Open
fix: scope VPC SNAT rule to exclude locally-generated packets (#13942)#13943waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
…#13942) On a VPC with public IPs from more than one range/VLAN, the virtual router installs an unscoped source NAT rule on every public interface using the single VPC source NAT address. Because the rule has no source match, it also rewrites traffic the router itself originates, so the VR cannot emit packets with the correct source address from any public interface other than the source-NAT one. Fix: add `-m addrtype ! --src-type LOCAL` to the elif SNAT rule so it only matches forwarded (guest) traffic, not locally-generated packets. Closes: apache#13942
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a VPC with public IPs from more than one range/VLAN, the virtual router installs an unscoped source NAT rule on every public interface using the single VPC source NAT address. Because the rule has no source match (
-s), it also rewrites traffic the router itself originates, so the VR cannot emit packets with the correct source address from any public interface other than the source-NAT one.Fix
Add
-m addrtype ! --src-type LOCALto theelifSNAT rule generated inCsAddress.py. This excludes packets whose source is an address on the router, while forwarded (guest) traffic still matches and is SNATed as before.Verification
The reporter verified the fix manually on the VR:
Closes: #13942