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

Update Juniper model, to only return best match for prefix #128

Closed
wants to merge 1 commit into from

Conversation

horsitis
Copy link
Contributor

Filter route lookup, to only show the best match for prefix.

Description

Filter route lookup, to only show the best match for prefix. Currently a user could search for 1.0.0.0/8, which would return a lot of results. I propose to only return results for prefix that best matches the query.

Filter results, to only show the best match for prefix.
@netlify
Copy link

netlify bot commented Mar 17, 2021

Deploy request for condescending-feynman-b53fb3 pending review.

Review with commit 99a2fce

https://app.netlify.com/sites/condescending-feynman-b53fb3/deploys

@thatmattlove
Copy link
Owner

Hi,

Sorry for the delay! And, thank you for being willing to contribute to hyperglass. While I understand what you mean, I don't think this should be the default. For me, when using another network's looking glass, it's borderline useless to only see the best path - I can usually infer that from a traceroute. When I'm troubleshooting something and think another network might be at fault or playing a part, I'm generally going to their LG because I need to see the bigger picture.

But, we're all entitled to our own opinions, which is why I made just about every part of hyperglass overridable :) See here for how to override the default commands. That said, I do not have a mechanism to override the commands for structured (table) output and this is intentional since hyperglass has to know the schema for the command output in advance. So, to truly override the default behavior for Juniper (or Arista), you'd need to override the command as well as set structured_output to false.

If this is primarily a security or load concern, you can always get fancy with the access list feature to allow only certain prefixes, or only certain prefix lengths.

Thanks,
Matt

@horsitis
Copy link
Contributor Author

@checktheroads Please reconsider. Adding best to the command, shows all the paths for that prefix, the command doesn't mean that it only shows the best path. The command means, that only best match for prefix is shown. This change would make the Junos return answer in the same way a Cisco router does. If you want the Cisco answer to be the same, as Junos is currently, then you need to add "longer-prefixes" to commands.
Now consider router with full tables. If i search for 1.0.0.0/8, this would return thousands of prefixes.

@diegocanton
Copy link

Please go back to the previous method.

Make this an option and not a fixed code. This update changed every strategy we used today. As Matt said, this as Variable would be better, to protect as Prefixes that are too long, a filter where you define the largest and smallest mask accepted would be enough.

@pmawsonau
Copy link

How do we remove "best". We want it to match longer prefixes too, and can use the ACL feature to limit down so you can't do anything bigger than /16 for example.

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.

4 participants