Files
PSOPNSenseAPI/docs/cmdlets/Set-OPNSenseDHCPOption.md

3.7 KiB

Set-OPNSenseDHCPOption

SYNOPSIS

Modifies an existing DHCP option on an OPNSense firewall.

SYNTAX

Set-OPNSenseDHCPOption -Interface <String> -Number <Int32> [-Type <String>] [-Value <String>] [-Description <String>]
                       [-WhatIf] [-Confirm]

DESCRIPTION

The Set-OPNSenseDHCPOption cmdlet modifies an existing DHCP option on an OPNSense firewall.

EXAMPLES

Example 1: Modify a DHCP option value

Set-OPNSenseDHCPOption -Interface "lan" -Number 66 -Value "newtftp.example.com"

This example updates the value of DHCP option 66 (TFTP server name) for the LAN interface.

Example 2: Modify a DHCP option description

Set-OPNSenseDHCPOption -Interface "lan" -Number 67 -Description "Updated Boot Filename"

This example updates the description of DHCP option 67 (boot filename) for the LAN interface.

PARAMETERS

-Interface

The interface on which the DHCP option exists.

Type: String
Parameter Sets: (All)
Aliases:

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

-Number

The option number to modify.

Type: Int32
Parameter Sets: (All)
Aliases:

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

-Type

The type of the DHCP option (string, integer, boolean, etc.).

Type: String
Parameter Sets: (All)
Aliases:

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

-Value

The value of the DHCP option.

Type: String
Parameter Sets: (All)
Aliases:

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

-Description

A description for the DHCP option.

Type: String
Parameter Sets: (All)
Aliases:

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

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

You can pipe strings containing the interface name and integers containing the option number to this cmdlet.

OUTPUTS

System.Object

Returns an object representing the modified DHCP option.

NOTES

This cmdlet requires a connection to an OPNSense firewall. Use Connect-OPNSense to establish a connection. After modifying a DHCP option, the DHCP server service may need to be restarted for the changes to take effect. The DHCP server must be enabled on the specified interface for options to be provided to clients.

Get-OPNSenseDHCPOption New-OPNSenseDHCPOption Remove-OPNSenseDHCPOption Get-OPNSenseDHCPServer Set-OPNSenseDHCPServer