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

Addresses not in proper prefix after scanning #6

Closed
mikeb93 opened this issue Jun 13, 2019 · 6 comments
Closed

Addresses not in proper prefix after scanning #6

mikeb93 opened this issue Jun 13, 2019 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@mikeb93
Copy link

mikeb93 commented Jun 13, 2019

EDIT: See PR #7

Hi,

thanks for this script, it's working great.
Only issues I have is that the Addresses which are found are not getting added into any prefix.
Looks like this is happening because there is no VRF added to the addresses.

Is there any way we can associate VRFs to the scanned subnets which will then be added to the addresses?
Also there are almost no hostnames or such added to the description. Can we maybe have an option to add vendor names to the description (from mac addresses)?

Thank you in advance. I'll try to find a way myself with my very very limited python skills, I'd buy you a beer or two If you can help out though! :)

@lopes
Copy link
Owner

lopes commented Jul 7, 2019

The main purpose of this script is to add only IP addresses --/32--, not prefixes. That's because I assume that the network organisation --prefixes, aggregations, and VRFs-- must be done manually by NOC engineers. It's quite hard to presume a prefix from a given IP address --e.g., 10.1.2.3/32 could belong either to prefix 10.1.2.0/24 or to prefix 10.1.2.0/25 or to prefix 10.1.2.0/26...

This way, IP address prefixes and aggregations are done by humans, because only they know how network should be organised. I've just reviewed you PR --thanks in advance--, but AFAIK, single IP addresses should be registered in /32 prefix, not using the mask of prefix they belong.

I'll keep both the issue and PR opened, to hear more from you.

BTW, sorry for the delay. I'm pretty busy these days, and, yes, I accept that beer. :)

@mikeb93
Copy link
Author

mikeb93 commented Jul 8, 2019

Hi, thanks for your reply and no worries about the delay.
In my specific case, the prefixes were already created. In my PR I'm asking the API for the prefix the single IP belongs to. Basically the same thing I'd do manually.
You don't usually have a 10.1.2.0/24, 10.1.2.0/25 and 10.1.2.0/26 prefix at the same time.
I did not consider different VRFs though (not sure how to, yet. I'll try to find a way to consider VFRs).

Maybe this can be implemented optionally like with a parameter --add-prefix for example?

@lopes
Copy link
Owner

lopes commented Jul 25, 2019

Your suggestion is good: if a certain flag is used, netbox-scanner will guess the prefix and append it to IP addr. If we use the current version of your PR, hosts will be recorded with network addresses, which is not right.

@mikeb93
Copy link
Author

mikeb93 commented Aug 1, 2019

I'm trying to update my PR to implement this if a flag is set but my free time for this is limited as well.

@mikeb93
Copy link
Author

mikeb93 commented Aug 21, 2019

Please check PR #7 which I updated.
I commented on the PR

@lopes
Copy link
Owner

lopes commented May 26, 2020

Thanks for your help. I created issue #18 and this will be fixed there along with other improvements.

@lopes lopes closed this as completed May 26, 2020
@lopes lopes added the bug Something isn't working label May 26, 2020
@lopes lopes self-assigned this May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants