Azure: add support for masquerading#42196
Merged
pchaigno merged 1 commit intocilium:mainfrom Oct 28, 2025
Merged
Conversation
Member
|
/test |
4 tasks
Contributor
|
changes lgtm. should we have any e2e/unit test to validate this? |
e71a30c to
acbb41a
Compare
Contributor
Author
|
Ok, added some tests:
|
Contributor
Author
|
/test |
acbb41a to
851623a
Compare
Contributor
Author
|
/test |
qmonnet
requested changes
Oct 22, 2025
Historically, Azure IPAM mode did not support masquerading at all. This PR enables Azure IPAM users to use masquerading via the ip-masq-agent or by setting --ipv4-native-routing-cidr. Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
851623a to
0c214ea
Compare
Contributor
Author
|
/test |
tamilmani1989
approved these changes
Oct 22, 2025
Contributor
Author
|
@cilium/sig-ipam @cilium/sig-agent Could I get a review from someone please? 🙏 |
tklauser
approved these changes
Oct 28, 2025
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.
Description
This PR adds support for Masquerading when using the Azure IPAM mode.
Users can configure masquerading by using the eBPF
ip-masq-agentor by setting--ipv4-native-routing-cidr. I think this should be enough to cover most use-cases to start with.We could also implement automatic Azure VNET CIDR detection and propagation to the masquerading config (similar to what AWS has for VPC CIDRs here) but it's something that can be implemented as a second step.
Testing
Backported the PR to our 1.18.2 fork. Then deployed the Agent on Azure with the following flags:
The config file looks like this:
Then deployed a pod on an Azure node, the pod's IP is
10.194.0.56. Verified that theip rules were properly set up with proper CIDR exclusions:Also attached a Public IP to the primary instance interface and verified that the pod's traffic was actually masqueraded with that Public IP: