Skip to main content
Version: current

lease


ip/dhcp-server/lease​

Type: Directory

Leases of the DHCP servers. Dynamic leases are created when clients get an address from a pool; static leases give a specific client a fixed address, a pool, or its own settings. For details, see DHCP Server.

FlagNameDescription
XdisabledThe lease is disabled.
RradiusThe lease was assigned by a RADIUS server.
DdynamicThe lease is dynamic: it was created when a client got an address from the pool. Use make-static to turn it into a static lease.
BblockedThe client is blocked (block-access=yes) and gets no reply from the server.
ArgumentTypeDescription
addressalt { ip-address: ipAddr , pool: enum }IP address of a static lease, or the name of an IP pool to give the client an address from. With 0.0.0.0, the address pool of the server is used.
mac-addressmacAddrMAC address of the client the static lease is for.
use-src-macboolWhether to identify the client by the source MAC address of its packets instead of the client hardware address field (chaddr) of the DHCP message.
client-idstringClient identifier (option 61) of the client the static lease is for, in the format shown in active-client-id, for example 1:4e:97:a1:4c:d1:38.
rate-limitstring

Bandwidth limit for the client, as rx-rate[/tx-rate] [rx-burst-rate[/tx-burst-rate] [rx-burst-threshold[/tx-burst-threshold] [rx-burst-time[/tx-burst-time]]]]. Rates are in bits per second, with an optional k or M suffix, and missing tx values are taken from the rx values. Only static leases can have a rate limit.

The server creates a dynamic simple queue named dhcp-ds<hostname/MAC> for the address of the lease, with this limit as limit-at and max-limit.

routesobject { route: composite { dst-address: address (flags=4/) , gateway: [ composite { gateway: address (flags=46ivL) , distance: [ num [1 .. 255]] }] } }Routes the server adds while the lease is bound, as dst-address/mask gateway distance entries separated by commas, for example 10.77.0.0/24 172.31.255.105 5.
insert-queue-beforeenum (bottom | first) { bottom:0xffffffff, first:0 }Where to place the dynamic simple queue created for this lease: first (default) at the top of /queue/simple, bottom at the end, or before the named queue.
parent-queueenum (none) { none:0 }Parent of the dynamic simple queue created for this lease. Default: none.
queue-typeenumQueue type of the dynamic simple queue created for this lease.
address-listsmulti { array-id, address-list: string }Firewall address lists to which the address of the lease is added while the lease is bound.
serverenum (all) { all:0 }DHCP server the lease belongs to. With all, the static lease is valid on every server.
block-accessboolWhether to block the client: the server does not answer it, and the lease gets the B flag. Default: no.
allow-dual-stack-queueboolWhether this lease and a DHCPv6 binding of the same client share one dynamic simple queue, which then contains both the IPv4 and the IPv6 address. Default: yes.
lease-timetimeLease time for this client. When not set, or set to 0s, the lease-time of the server is used.
always-broadcastboolWhether to broadcast replies to this client even when it has not set the broadcast flag. Default: no.
dhcp-optionmulti { array-id, option: enum }Options (/ip/dhcp-server/option) to send to this client. They take precedence over the options of the server and of the network.
dhcp-option-setenum (none)Option set (/ip/dhcp-server/option/sets) to send to this client. It takes precedence over the options of the server and of the network.
agent-circuit-idstringWhen set, the lease matches requests whose relay agent information (option 82) contains this circuit ID, even if the MAC address or client ID differ.
agent-remote-idstringWhen set, the lease matches requests whose relay agent information (option 82) contains this remote ID, even if the MAC address or client ID differ.
Read-only ArgumentTypeDescription
statusenum (waiting | testing | declined | offered | bound | authorizing | conflict) { waiting:0, testing:1, declined:2, offered:3, bound:4, authorizing:5 }

State of the lease:

  • waiting - A static lease that is not in use.
  • testing - The server is checking the address for conflicts (conflict-detection).
  • offered - The server offered the address and waits for the client's request.
  • bound - The client uses the address.
  • authorizing - The server waits for the reply from the RADIUS server.
  • conflict - Another host already uses the address. The lease keeps the address out of use for the lease time; check-status frees it when the other host no longer answers.
  • declined - The client declined the address with a DHCPDECLINE message.
expires-aftertimeTime until the lease expires.
last-seenalt { symbolic-names: enum (never | sometime) { never:0xffffffff, sometime:0xfffffffe } , time: time }Time since the server last received a request from the client, or never.
agetimeTime since the lease was created.
active-addressipAddrIP address the client uses.
active-mac-addressmacAddrMAC address of the client that uses the lease.
active-client-idstringClient identifier (option 61) of the client that uses the lease.
active-serverenumDHCP server that serves the client.
active-agent-circuit-idstringCircuit ID from the relay agent information (option 82) of the client's request, in hex.
active-agent-remote-idstringRemote ID from the relay agent information (option 82) of the client's request, in hex.
active-agent-circuit-id-asciistringCircuit ID from the relay agent information (option 82) of the client's request, as text.
active-agent-remote-id-asciistringRemote ID from the relay agent information (option 82) of the client's request, as text.
host-namestringHost name the client sent (option 12).
class-idstringDHCP option 60 from last received DHCP request
src-mac-addressmacAddrSource MAC address of the client's last request.
reconfigure-keystringKey the server gave the client, in its reply when the client bound, for authenticating Reconfigure messages (RFC 6704, HMAC-MD5). Requires use-reconfigure on the server.
reconfigure-last-sentstringReplay-detection counter of the last Reconfigure message sent to the client. It increases with every Reconfigure message.
reconfigure-statusstring