Skip to content

Add-RouterOsIpDhcpServer

SYNOPSIS

Setup the DHCP server

SYNTAX

Default

Add-RouterOsIpDhcpServer [-ComputerName] <String> [-Port] <Int32> [-Credential] <PSCredential> [-ShowCommand]
 [-AddArp <String>] [-AddressPool <String>] [-AllowDualStackQueue <String>] [-AlwaysBroadcast <String>]
 [-Authoritative <String>] [-BootpLeaseTime <String>] [-BootpSupport <String>] [-ClientMacLimit <String>]
 [-Comment <String>] [-ConflictDetection <String>] [-CopyFrom <String>] [-DelayThreshold <String>]
 [-DhcpOptionSet <String>] [-Disabled <String>] [-InsertQueueBefore <String>] -Interface <String>
 [-LeaseScript <String>] [-LeaseTime <String>] [-Name <String>] [-ParentQueue <String>] [-Relay <String>]
 [-ServerAddress <String>] [-UseFramedAsClassless <String>] [-UseRadius <String>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

Session

Add-RouterOsIpDhcpServer [-ShowCommand] -Session <RouterOsSession> [-AddArp <String>] [-AddressPool <String>]
 [-AllowDualStackQueue <String>] [-AlwaysBroadcast <String>] [-Authoritative <String>]
 [-BootpLeaseTime <String>] [-BootpSupport <String>] [-ClientMacLimit <String>] [-Comment <String>]
 [-ConflictDetection <String>] [-CopyFrom <String>] [-DelayThreshold <String>] [-DhcpOptionSet <String>]
 [-Disabled <String>] [-InsertQueueBefore <String>] -Interface <String> [-LeaseScript <String>]
 [-LeaseTime <String>] [-Name <String>] [-ParentQueue <String>] [-Relay <String>] [-ServerAddress <String>]
 [-UseFramedAsClassless <String>] [-UseRadius <String>] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

Set up the DHCP server

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-RouterOsIpDhcpServer -Session $session -AddressPool "dhcp_pool" -Disabled no -Interface $BridgeName -Name "dhcp"
Remove-RouterOsSession -Session $session
RouterOS CLI
/ip dhcp-server add address-pool=dhcp_pool disabled=no interface=local name=dhcp

Example

Using PSCredential
$Credential = $([pscredential]::New('admin',$(ConvertTo-SecureString -String 'admin' -AsPlainText -Force)))
Add-RouterOsIpDhcpServer -ComputerName '10.0.0.1' -Port 22 -Credential $Credential -AddressPool "dhcp_pool" -Disabled no -Interface $BridgeName -Name "dhcp"
RouterOS CLI
/ip/dhcp-server/add address-pool=dhcp_pool disabled=no interface=local name=dhcp

PARAMETERS

-AddArp

{{ Fill AddArp Description }}

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: yes, no

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

-AddressPool

{{ Fill AddressPool Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-AllowDualStackQueue

{{ Fill AllowDualStackQueue Description }}

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: yes, no

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

-AlwaysBroadcast

{{ Fill AlwaysBroadcast Description }}

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: yes, no

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

-Authoritative

{{ Fill Authoritative Description }}

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: yes, no, after-2sec-delay, after-10sec-delay

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

-BootpLeaseTime

{{ Fill BootpLeaseTime Description }}

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: forever, lease-time

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

-BootpSupport

{{ Fill BootpSupport Description }}

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: dynamic, none, static

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

-ClientMacLimit

{{ Fill ClientMacLimit Description }}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
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

-ConflictDetection

{{ Fill ConflictDetection Description }}

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: yes, no

Required: False
Position: Named
Default value: None
Accept pipeline input: False
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

-DelayThreshold

{{ Fill DelayThreshold Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-DhcpOptionSet

{{ Fill DhcpOptionSet Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-Disabled

{{ Fill Disabled Description }}

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: yes, no

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

-InsertQueueBefore

{{ Fill InsertQueueBefore Description }}

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: bottom, first

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

-LeaseScript

{{ Fill LeaseScript Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-LeaseTime

{{ Fill LeaseTime Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-Name

{{ Fill Name Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-ParentQueue

{{ Fill ParentQueue 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

-Relay

{{ Fill Relay Description }}

Type: String
Parameter Sets: (All)
Aliases:

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

-ServerAddress

{{ Fill ServerAddress Description }}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
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

-UseFramedAsClassless

{{ Fill UseFramedAsClassless Description }}

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: yes, no

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

-UseRadius

{{ Fill UseRadius Description }}

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: yes, no, accounting

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