Skip to content

Add-RouterOsIpAddress

SYNOPSIS

Add new address

SYNTAX

Default

Add-RouterOsIpAddress [-ComputerName] <String> [-Port] <Int32> [-Credential] <PSCredential> [-ShowCommand]
 -Address <String> -Interface <String> [-Comment <String>] [-CopyFrom <String>] [-Disabled] [-Network <String>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

Session

Add-RouterOsIpAddress [-ShowCommand] -Session <RouterOsSession> -Address <String> -Interface <String>
 [-Comment <String>] [-CopyFrom <String>] [-Disabled] [-Network <String>] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

Add new address

EXAMPLES

Example

Using Session
$Credential = $([pscredential]::New('admin',$(ConvertTo-SecureString -String 'admin' -AsPlainText -Force)))
$session = New-RouterOsSession -ComputerName '10.0.0.1' -Port 22 -Credential $Credential
Add-RouterOsIpAddress -Session $session -Address '192.168.88.1/24' -Interface 'local' -Network '192.168.88.0'
Remove-RouterOsSession -Session $session
RouterOS CLI
/ip address add address=192.168.88.1/24 interface=local network=192.168.88.0

Example

Using PSCredential
$Credential = $([pscredential]::New('admin',$(ConvertTo-SecureString -String 'admin' -AsPlainText -Force)))
Add-RouterOsIpAddress -ComputerName '10.0.0.1' -Port 22 -Credential $Credential -Address '192.168.88.1/24' -Interface 'local' -Network '192.168.88.0'
RouterOS CLI
/ip/address/add address=192.168.88.1/24 interface=local network=192.168.88.0

PARAMETERS

-Address

{{ Fill Address Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-Comment

{{ Fill Comment Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-ComputerName

{{ Fill ComputerName Description }}

Type: String
Parameter Sets: Default
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-CopyFrom

{{ Fill CopyFrom Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-Credential

{{ Fill Credential Description }}

Type: PSCredential
Parameter Sets: Default
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Disabled

{{ Fill Disabled Description }}

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Interface

{{ Fill Interface Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-Network

{{ Fill Network Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-Port

{{ Fill Port Description }}

Type: Int32
Parameter Sets: Default
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Session

{{ Fill Session Description }}

Type: RouterOsSession
Parameter Sets: Session
Aliases:

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

-ShowCommand

{{ Fill ShowCommand Description }}

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

System.String

System.Int32

System.Management.Automation.PSCredential

psrouteros.Helper.RouterOsSession

OUTPUTS

System.Void

NOTES