Skip to content

Conversation

youssefazrak
Copy link
Contributor

When using the Bugtool with "direct routing / native routing mode" enabled, we are only getting the encryption and proxy tables (200 / 2005).

The goal of this PR is to get the route tables dynamically and remove the hardcoded ones.

Signed-off-by: Youssef Azrak yazrak.tech@gmail.com

Fixes: #12250

Bugtool: route tables are dynamically dumped

@youssefazrak youssefazrak requested a review from a team as a code owner December 23, 2020 19:56
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Dec 23, 2020
Copy link
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for the PR! One suggestion to try out below, otherwise LGTM.

@christarazi christarazi added release-note/misc This PR makes changes that have no direct user impact. area/bugtool Impacts gathering of data for debugging purposes. kind/enhancement This would improve or streamline existing functionality. and removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Dec 23, 2020
@youssefazrak youssefazrak changed the title [WIP] Bugtool: route tables dynamically dumped Bugtool: route tables dynamically dumped Dec 23, 2020
When using the Bugtool with "direct routing / native routing mode" enabled, we
are only getting the encryption and proxy tables (200 / 2005).

The goal of this PR is to get the route tables dynamically and remove the
hardcoded ones.

Fixes: cilium#12250

Signed-off-by: Youssef Azrak yazrak.tech@gmail.com
Copy link
Member

@aanm aanm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 💯

@aanm aanm merged commit 9a058d6 into cilium:master Dec 28, 2020
// routeCommands gets the routes tables dynamically.
func routeCommands() []string {
commands := []string{}
routes, _ := execCommand("ip route show table all | grep -E --only-matching 'table [0-9]+'")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@youssefazrak does this mean we won't dump from tables like table local / table main? I guess table main is already handled by the "ip -4 r" case above, but could table local also have relevant information?

Copy link
Contributor Author

@youssefazrak youssefazrak Feb 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @joestringer Indeed that is my understanding. ip -4 r drop the table main but not table local.
The local routes of the table local are the routes to a locally hosted IP, basically the L3 interfaces' IPs. We already have this output from the ip a command.
The broadcast part for the broadcast addresses but this is also given by ip a.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that sounds reasonable to me. Thanks for the clarification!

@youssefazrak youssefazrak deleted the fix_sysdump_routes branch February 5, 2021 10:56
@twpayne
Copy link
Contributor

twpayne commented Mar 16, 2021

Proposing this PR for backport to 1.8 and 1.9 as it provides helpful debugging information that is equally relevant to older versions.

@youssefazrak
Copy link
Contributor Author

youssefazrak commented Mar 19, 2021

@twpayne any pointers on how to put the PR for backport to 1.8/1.9?
Cheers

@twpayne
Copy link
Contributor

twpayne commented Mar 19, 2021

@twpayne any pointers on how to put the PR for backport to 1.8/1.9?

This should happen automagically. I added the needs-backport/1.8 and needs-backport/1.9 labels, which means this PR should be picked up by the people doing backports this week.

@youssefazrak
Copy link
Contributor Author

@twpayne thanks for the explanation.
Btw as we are talking about the bugtool, this PR could be backported too: #14568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bugtool Impacts gathering of data for debugging purposes. kind/enhancement This would improve or streamline existing functionality. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cilium bugtool / sysdump doesn't gather all route tables in native routing mode
8 participants