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

Add configuration option to ignore IP Fabric /32 networks #506

Open
justinbrink opened this issue Aug 19, 2024 · 0 comments
Open

Add configuration option to ignore IP Fabric /32 networks #506

justinbrink opened this issue Aug 19, 2024 · 0 comments
Labels
integration: ipfabric Issues/PRs for IPFabric integration type: enhancement New feature or request type: major feature

Comments

@justinbrink
Copy link

Environment

  • Nautobot version: 2.x
  • nautobot-ssot version: 2.7

Proposed Functionality

Add a configuration option to the IP Fabric adapter to allow the subnet mask matching to ignore the /32 networks auto populated by automatic discovery and load a /32 address in the parent supernet that is defined. If no subnet is defined as a parent supernet, it will load /32 by default. This would allow IP Fabric SSoT imports to match Infoblox (or other) SSoT imports that have /32 addresses defined inside of a /24 network.

I'll submit a PR if this is acceptable, but the summary of the changes are simple:
nautobot_ssot/integrations/ipfabric/constants.py:

+IP_FABRIC_IGNORE_32_NETMASK = CONFIG.get("ipfabric_ignore_32_netmask", False)

nautobot_ssot/integrations/ipfabric/diffsync/adapter_ipfabric.py:

                ip_network = ipaddress.ip_network(ip_address)
                for network in networks[device_model.location_name]:
+                   if IP_FABRIC_IGNORE_32_NETMASK and network.prefixlen == 32:
+                       continue
                    if network.supernet_of(ip_network):
                        subnet_mask = str(network.netmask)
                        break

Use Case

IP Fabric automatic discovery populates a device and networks with:

Manged Networks:
10.0.0.0/24
    |->   10.0.1.10/32

Device:
    |->Interface
        |-> PrimaryIP: 10.0.1.10

Infoblox is configured with:

Network Container 10.0.0.0/16
    |-> Network 10.0.1.0/24
        |-> Host 10.0.1.10

Current results: 10.0.1.0/32 =/= 10.0.1.0/24, new IP address 10.0.1.0/32 creation is attempted and fails for duplicate IP

Proposed result: 10.0.1.0/24 is matched from IP fabric, no IP creation is attempted if it exists from Infoblox

@jdrew82 jdrew82 added type: enhancement New feature or request type: major feature integration: ipfabric Issues/PRs for IPFabric integration labels Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration: ipfabric Issues/PRs for IPFabric integration type: enhancement New feature or request type: major feature
Projects
None yet
Development

No branches or pull requests

2 participants