Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix source interface determination in encryption tests when rp_filter is set to strict #2113

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

giorio94
Copy link
Member

2ff3df0 ("connectivity: fix encryption validation when running in ENI mode") fixed the encryption validation when running in ENI mode, by extending the source interface determination logic to additionally consider the source address, i.e., running

ip route get dst from src iif lo

The iif lo part is required, otherwise the command returns "RTNETLINK answers: Network is unreachable" in case the src address is not assigned to any local interface (which is expected, being src a pod IP).

Yet, this fails with "RTNETLINK answers: Invalid cross-device link" in case rp_filter=1 (strict) is set of the given interface (lo in this case). Given that any local interface can be used there, let's switch it to cilium_host, as it is managed by Cilium, and we explicitly set rp_filter=0 to it.

Fixes: 2ff3df0 ("connectivity: fix encryption validation when running in ENI mode")
Fixes: cilium/cilium#29197

2ff3df0 ("connectivity: fix encryption validation when running in
ENI mode") fixed the encryption validation when running in ENI mode, by
extending the source interface determination logic to additionally
consider the source address, i.e., running

  ip route get dst from src iif lo

The `iif lo` part is required, otherwise the command returns "RTNETLINK
answers: Network is unreachable" in case the src address is not assigned
to any local interface (which is expected, being src a pod IP).

Yet, this fails with "RTNETLINK answers: Invalid cross-device link" in case
rp_filter=1 (strict) is set of the given interface (lo in this case). Given
that any local interface can be used there, let's switch it to cilium_host,
as it is managed by Cilium, and we explicitly set rp_filter=0 to it.

Fixes: 2ff3df0 ("connectivity: fix encryption validation when running in ENI mode")
Fixes: cilium/cilium#29197
Signed-off-by: Marco Iorio <[email protected]>
@giorio94 giorio94 marked this pull request as ready for review November 16, 2023 13:49
@giorio94 giorio94 requested a review from a team as a code owner November 16, 2023 13:49
@brb brb merged commit 0ed8df7 into cilium:main Nov 16, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cilium connectivity test "Failed to get IP route"
2 participants