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

Support the case of default gateway outside any subnet #27

Open
silverwind opened this issue Jul 1, 2019 · 1 comment
Open

Support the case of default gateway outside any subnet #27

silverwind opened this issue Jul 1, 2019 · 1 comment

Comments

@silverwind
Copy link
Collaborator

silverwind commented Jul 1, 2019

The module currently assumes that the default gateway lies within one of the configured interface subnets but there are cases where this assumption does not hold true.

One example is a Travis VM having 10.20.0.153/32 with gateway 10.20.0.1. Strictly speaking, this is a invalid network configuration but it somehow still works so we need to account for it.

One approach could be to find the address nearest to the gateway. It's a guess but chances are it might be correct. To get the nearest IPv6 adress conveniently, we need to convert both the address CIDR and gateway address to a BigInt and then compare them, so I would like to require native BigInt (node 10.4.0+).

@silverwind
Copy link
Collaborator Author

Published https://github.com/silverwind/ip-bigint to convert IP <-> BigInt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants