Skip to content

New-NBDCIMInterface

Since

v1.0.4

SYNOPSIS

Creates one or more interfaces on devices in Netbox DCIM module.

SYNTAX

Single (Default)

New-NBDCIMInterface -Device <UInt64> -Name <String> [-Type <String>] [-Label <String>] [-Parent <UInt64>]
 [-Bridge <UInt64>] [-Speed <UInt64>] [-Duplex <String>] [-Mark_Connected <Boolean>] [-WWN <String>]
 [-VDCS <UInt64[]>] [-POE_Mode <String>] [-POE_Type <String>] [-Vlan_Group <UInt64>] [-QinQ_SVLAN <UInt64>]
 [-VRF <UInt64>] [-RF_Role <String>] [-RF_Channel <String>] [-RF_Channel_Frequency <Int32>]
 [-RF_Channel_Width <Int32>] [-TX_Power <Int32>] [-Primary_MAC_Address <UInt64>] [-Owner <UInt64>]
 [-Changelog_Message <String>] [-Enabled <Boolean>] [-MTU <UInt16>] [-MAC_Address <String>]
 [-MGMT_Only <Boolean>] [-LAG <UInt64>] [-Description <String>] [-Mode <String>] [-Untagged_VLAN <UInt64>]
 [-Tagged_VLANs <UInt64[]>] [-Tags <Object[]>] [-Raw] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

Bulk

New-NBDCIMInterface -InputObject <PSObject> [-BatchSize <Int32>] [-Force] [-Tags <Object[]>] [-Raw]
 [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Creates new network interfaces on specified devices. Supports both single interface creation with individual parameters and bulk creation via pipeline input.

For bulk operations, use the -BatchSize parameter to control how many interfaces are sent per API request. This significantly improves performance when creating many interfaces.

EXAMPLES

EXAMPLE 1

New-NBDCIMInterface -Device 42 -Name "eth0" -Type "1000base-t"

Creates a new 1GbE interface named 'eth0' on device ID 42.

EXAMPLE 2

New-NBDCIMInterface -Device 42 -Name "bond0" -Type "lag" -Description "Server uplink LAG"

Creates a new LAG interface for link aggregation.

EXAMPLE 3

$interfaces = 0..47 | ForEach-Object {
    [PSCustomObject]@{Device=42; Name="eth$_"; Type="1000base-t"}
}
$interfaces | New-NBDCIMInterface -BatchSize 50 -Force

Creates 48 interfaces in bulk using a single API call.

EXAMPLE 4

Import-Csv interfaces.csv | New-NBDCIMInterface -BatchSize 100 -Force

Bulk import interfaces from CSV file.

PARAMETERS

-Device

The database ID of the device to add the interface to.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: True
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Name

The name of the interface (e.g., 'eth0', 'GigabitEthernet0/1').

Type: String
Parameter Sets: Single
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Type

The interface type. Supports physical types (1000base-t, 10gbase-x-sfpp, etc.), virtual types (virtual, bridge, lag), and wireless types (ieee802.11ac, etc.).

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Label

Physical label assigned to the interface.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Parent

Numeric ID of the parent interface (for subinterfaces).

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Bridge

Numeric ID of the bridge this interface belongs to.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Speed

Speed of the interface in Kbps (e.g., 1000000 for 1Gbps).

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Duplex

Duplex mode. One of: 'full', 'half', 'auto'.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Mark_Connected

If $true, the interface is marked as connected independent of cable state.

Type: Boolean
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WWN

World Wide Name for Fibre Channel interfaces (8 groups of 2 hex digits, colon-separated, e.g. 'AA:BB:CC:DD:EE:FF:00:11').

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-VDCS

Array of Virtual Device Context numeric IDs.

Type: UInt64[]
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-POE_Mode

Power-over-Ethernet mode. One of: 'pd', 'pse'.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-POE_Type

Power-over-Ethernet type. One of: 'type1-ieee802.3af', 'type2-ieee802.3at', 'type3-ieee802.3bt', 'type4-ieee802.3bt', 'passive-24v-2pair', 'passive-24v-4pair', 'passive-48v-2pair', 'passive-48v-4pair'.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Vlan_Group

Numeric ID of the VLAN group this interface belongs to.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-QinQ_SVLAN

Numeric ID of the Service VLAN for QinQ.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-VRF

Numeric ID of the VRF this interface belongs to.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-RF_Role

Wireless RF role. One of: 'ap', 'station'.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-RF_Channel

Wireless RF channel identifier (e.g. '2.4g-1-2412-22').

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-RF_Channel_Frequency

Wireless RF channel frequency in MHz (1-1000000).

Type: Int32
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-RF_Channel_Width

Wireless RF channel width in MHz (1-10000).

Type: Int32
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-TX_Power

Wireless transmit power in dBm.

Type: Int32
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Primary_MAC_Address

Numeric ID of the primary MAC address record. Use New-NBDCIMMACAddress to create a MAC address record, then pass its id here.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Owner

Numeric ID of the owning user or team.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Changelog_Message

Free-form message recorded in the Netbox changelog entry for this operation.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Enabled

Whether the interface is enabled. Defaults to true if not specified.

Type: Boolean
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-MTU

Maximum Transmission Unit size (typically 1500 for Ethernet).

Type: UInt16
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-MAC_Address

The MAC address of the interface in format XX:XX:XX:XX:XX:XX.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-MGMT_Only

If true, this interface is used for management traffic only.

Type: Boolean
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-LAG

The database ID of the LAG interface this interface belongs to.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Description

A description of the interface.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Mode

VLAN mode: 'Access' (untagged), 'Tagged' (trunk), or 'Tagged All'.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Untagged_VLAN

The database ID of the VLAN object for the untagged/native VLAN.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Tagged_VLANs

Array of database IDs of VLAN objects for tagged VLANs.

Type: UInt64[]
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-InputObject

Pipeline input for bulk operations. Each object should contain the required properties: Device, Name, Type.

Type: PSObject
Parameter Sets: Bulk
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-BatchSize

Number of interfaces to create per API request in bulk mode. Default: 50, Range: 1-1000

Type: Int32
Parameter Sets: Bulk
Aliases:

Required: False
Position: Named
Default value: 100
Accept pipeline input: False
Accept wildcard characters: False

-Force

Skip confirmation prompts for bulk operations.

Type: SwitchParameter
Parameter Sets: Bulk
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Tags

Array of tag objects (e.g. PSCustomObject with slug and color properties).

Type: Object[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Raw

Return the raw API response instead of the results array.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Management.Automation.PSObject

NOTES

AddedInVersion: v1.0.4

Common parameters

common request params
common bulk params

https://netbox.readthedocs.io/en/stable/models/dcim/interface/