.. meta:: :description: How to import IP address ranges or IP addresses into Micetro by Men&Mice :keywords: IPAM, IPAM data, Micetro .. _webapp-import-ipam-data: Import IPAM data ================ Overview -------- To import IP address ranges or IP addresses into Micetro, the Import wizard in Networks can be used. The Import wizard can be used to import: * Networks * IP addresses (and DNS hosts) * Devices and interfaces * DHCP reservations The data can either be pasted directly into the wizard or by using a file that is uploaded. .. image:: ../../images/import.png :width: 90% :align: center Prerequisites ------------- The user importing must have the following permissions: * Access to IPAM Module * Access to the Web Application * Access to IPAM view in Web Application * Access to "Import Data" web task (See :ref:`permissions-reference`.) Importing Data -------------- The lines in the import text, or the contents of the file chosen, must have lines whose columns/fields are separated by either comma ``,``, semicolon ``;``, pipe ``|`` or the tab character. For instance, when cells of a spreadsheet are highlighted and copied to the clipboard, they will be tab separated when pasted into the text area of the Import Data wizard. When importing a fair amount of lines stored in an excel spreadsheet, this is probably the easiest method of getting the data into the Import Data wizard. .. note:: When choosing files, only plaintext CSV/TSV/TXT files are accepted. Excel spreadsheets need to be exported to one of these formats prior to importing. Clearing values ^^^^^^^^^^^^^^^ When the value in a particular column is empty, it is by default not cleared. Instead it is not included in the import. This makes it possible to update certain fields and leave others as is, in the same import. To clear values for a custom property, e.g. Responsible Person, use one of these clearing tokens instead of a blank value: ``$null``, ``%clear``, ````, ````, or ````. These tokens will only be interpreted to clear the field if field contains only the token and nothing else. For example if the field value is "This is " in the import text, the field would not be cleared, but set to that value instead. See :ref:`import-ipam-example-5`. Header line ^^^^^^^^^^^ The first line of the data must be the header line, containing the name of the fields in the corresponding columns of the lines after it. Some of the fields refer to built-in system fields, and are different depending on what is being imported. The rest of the fields are according to the custom properties that are defined for the object type in question. It's only necessary to include the fields that need to be imported/updated, except for properties that are defined as mandatory, or required to be able to identify the object to import. The field names in the header line are not case sensitive. For example, "title" will be correlated to the custom property "Title". Action field """""""""""" In addition, there's an optional column for "Action", which defines whether the object specified in the line should be added, removed or modified (defaults to "Add" when not specified) The action column is identified by one of the following fieldnames: "Action", "Operation" or "ActionType". If one of the custom fields defined conflicts with these names, the custom field has precedence and the column is not identified as the action column. In that case use one of the provided alternatives for the action column that does not conflict with a custom property name. The Action field has three possible values Add Default for Range Import. **Create**, **New**, and **Import** are equivalent alternatives. Update Default for IP Address Import. **Modify** and **Mod** are equivalent alternatives. Delete **Remove** and **Del** are equivalent alternatives. Ranges ^^^^^^ Range column: """"""""""""" To identify the range to import, there are three options * Include a "Range" column (alternatives: "Name", "Network", "Network range", "IP range", "IP Address range" or "IPRange") and provide the range in CIDR format (e.g. 192.168.1.0/24) or from-to format (e.g. 192.168.1.0-192.168.1.255) * Include a "Network_address" and "Network_mask" columns, with the network address (e.g. 192.168.1.0) and network mask (e.g. 255.255.255.0) as values. This will be converted automatically to the CIDR format, and displayed in a single Range column in the next step * Include a "from" and "to" columns, with the from and to address of the range to import The first option should be preferred. The other two options are provided for convenience when the ranges are stored across two columns in the source spreadsheet. Built-in fields: """""""""""""""" Container? Identified in header line by either "isContainer", "is_Container" or "is Container" If set to Yes, then the range will be marked as container, or as Range/Scope when set to "No" (or not updated if blank). See :ref:`ipam-containers` for more information on the Container property. Locked? Identified in header line by: "Locked", "isLocked", "is_Locked" or "is Locked" If set to Yes, locks the range. No unlocks it (blank does not update). See :ref:`ipam-range-config` for more information on Locked. Allow auto-assignment of IP Addresses? Identified in the header line by: "AutoAssign", "Auto-Assign", "Auto_Assign" or "Auto Assign". Set to Yes or No to set or unset the property. Leave blank to not update. See :ref:`ipam-range-config` for more information on Allow auto-assignment of IP Addresses. Reserve Network and Broadcast Address? Identified in the header line by: "Subnet", "isSubnet", "is_Subnet" or "is Subnet" Set to Yes or No to set or unset the property. Leave blank to not update. See :ref:`ipam-range-config` for more information on Reserve Network and Broadcast Address. AD site Identified in the header line by: "ADSite", "AD Site" or "ADSiteRef" Associates the Range with the given AD Site, provided either as the name of the AD site (if unique) or the internal reference id of the AD Site (e.g. "{#12-#1009}"). See :ref:`active-directory` for more information on this property. Custom fields: """""""""""""" In addition to the built-in fields for Ranges, all the custom fields that are defined for Ranges can be populated with values. If there is a conflict between the custom fields and the built-in fields, the custom field name will have precedence, and one of the provided alternatives will need to be used for the built-in fields. IP addresses ^^^^^^^^^^^^ IP addresses can be imported when the Import Data wizard is opened from within a particular Network, or from the Networks overview page where networks can also be imported in the same wizard. IP Address column: """""""""""""""""" To identify which IP address to import, provide a column where the header is one of: "IP Address", "IPAddress", "IP", "IP-Address" or "Name", and provide the IP address to import in that column Built-in fields: """""""""""""""" Claimed? Identified in header line by "Claimed" and "is_Claimed" If set to "Yes", the IP is claimed permanently. "No" waives the claim, if claimed. DNS Hosts Identified in header line by: "DNS Hosts" or "DNS Records" (plural or singular, space can be removed or replaced with "_") The column should be a list of fully qualified hostnames that should be added to the IP, space or comma separated, or that need to be removed from the IP. To remove specific hostnames, prefix the hostname with a hyphen "-". To clear all DNS records from the IP, use the value "$null" or "%clear". Otherwise, the hostnames are added to the IP, if they don't exist already. This means these DNS records are created in the appropriate DNS Zones during the import. Custom fields: """""""""""""" Same applies here as for Ranges; all the custom properties defined for IP addresses can be imported. DHCP Reservations ^^^^^^^^^^^^^^^^^ DHCP reservations can be imported when the Import Data wizard is opened from within a particular Network, or from the Networks overviwe page. .. Note:: DHCP reservations can only be imported within a DHCP scope. Examples -------- Example 1 ^^^^^^^^^ This example creates imports two ranges, 1.2.3.0/24 and 1.2.4.0/24 with the respective titles and descriptions. .. code-block:: Range,Title,Description 1.2.3.0/24, My range, My first range to import 1.2.4.0/24, My range2, My second range to import Example 2 ^^^^^^^^^ This example creates deletes two ranges, 1.2.3.0/24 and 1.2.4.0/24. .. code-block:: Action,Range Delete,1.2.3.0/24 Delete,1.2.4.0/24 Example 3 ^^^^^^^^^ This example updates properties on the, 1.2.3.0/24 and 1.2.4.0/24. Notice how the mandatory Title column can be omitted during update, and will be left as is, whether currently empty or not. .. code-block:: Action,Range,Location Update,1.2.3.0/24, US Update,1.2.4.0/24, US Example 4 ^^^^^^^^^ This example updates information on two IP addresses. .. code-block:: IP, Responsible Person 1.2.3.10, Jon 1.2.4.11, Snow .. _import-ipam-example-5: Example 5 ^^^^^^^^^ This example clears Responsible Person property on two IP addresses. .. code-block:: IP, Responsible Person 1.2.3.10, $null 1.2.4.11, $null Example 6 ^^^^^^^^^ This example Adds DNS records to two IP addresses, and clears from the third. .. code-block:: IP, DNS Hosts 1.2.3.10, hostname.company.com hostname.company2.com 1.2.4.11, -hostname2.comany.com hostname3.company.com 1.2.4.12, $null Example 7 ^^^^^^^^^ This example shows how to set properties and add reservations to IPs, both DHCPv4 and DHCPv6 .. code-block:: DHCPv4 IP Address, Name, Method, ClientIdentifier, Type, DDNS hostname (optional) 1.1.4.1, Test, HardwareAddress, 00:00:00:00:00:01, DHCP, ddi.com 1.1.4.4, Test, ClientIdentifier, 00:00:00:00:00:04, BOOTP, .. code-block:: MS DHCPv6 IP Address, Name, DUID, IAID 2001::df07, Test, 0001ac2378bc0987, 1337 .. code-block:: Kea DHCPv6 IP Address, Method, Clientidentifier, DDNS hostname (optional) 2002::df27, HardwareAddress, 12:56:00:22:34:22, ddi.com 2002::df28, ClientIdentifier, 67:48:21:99:59:11 Example 8 ^^^^^^^^^ This example shows how to modify an already existing reservation. .. code-block:: DHCPv4 Action,IPAddress,ClientIdentifier,Name Update, 1.1.4.1,00:00:00:00:00:10, new name Update, 1.1.4.2,00:00:00:00:00:20, also a new name .. code-block:: MS DHCPv6 Action,IPAddress,DUID,IAID,Name Update, 2001::df07, 0001ac2378bc0987, 1337, new name .. code-block:: Kea DHCPv6 Action,IPAddress,ClientIdentifier,DDNSHostname (optional) Update, 2001:db8:6:0:e0f3:edc6:4dc0:df07, 78:00:77:66:55:55, hus.com Example 9 ^^^^^^^^^ This example shows how to remove a reservation from an IP address. .. code-block:: DHCPv4 Action,IPAddress Del,1.1.4.1 .. code-block:: DHCPv6 Action,IPAddress Del,2010::b897:2aaa:b854:c10c