/ipv6/dhcp-client
dhcp-client
The DHCPv6 client requests IPv6 addresses, delegated prefixes (DHCPv6-PD) or other settings from a DHCPv6 server. For an overview and configuration examples, see DHCPv6 Client. For how DHCPv6 differs from DHCP for...
ipv6/dhcp-client
Type: Directory
DHCPv6 客户端从 DHCPv6 服务器请求 IPv6 地址、委派前缀(DHCPv6-PD)或其他设置。概述和配置示例参见 DHCPv6 客户端。有关 DHCPv6 与 IPv4 DHCP 的区别,参见 DHCP。
| 标志 | 名称 | 描述 |
|---|---|---|
D | dynamic | DHCPv6 客户端是动态创建的。 |
X | disabled | DHCPv6 客户端已禁用。 |
I | invalid | DHCPv6 客户端配置无效。 |
| 参数 | 类型 | 描述 |
|---|---|---|
interface * | iface_enum | 客户端运行的接口。收到的地址将作为动态 /128 地址添加到此接口。 |
request * | ubit (info, address, prefix) | 客户端向服务器请求的内容。一个客户端可以请求多项: - address - IPv6 地址(IA_NA),作为动态 /128 地址添加到客户端接口。 - prefix - 委派前缀(IA_PD),添加到 pool-name 中设置的 IPv6 池。 - info - 仅其他设置,不含地址或前缀(Information-request)。客户端状态随后为 idle。 |
accept-prefix-without-address | bool | 同时请求地址和前缀时:是否接受包含前缀但不含地址的回复。使用 no 时,客户端会持续请求,直到服务器同时提供两者。默认值:yes。 |
add-default-route | bool | 是否通过 DHCPv6 服务器添加默认路由(::/0),或在回复来自中继时通过该中继添加。DHCPv6 本身不提供默认网关。默认值:no。 |
default-route-distance | num | 客户端添加的默认路由的距离。默认值:1。 |
default-route-tables | object { table: alt { table-distance: composite { table: alt { table-default: enum (default) { default:0xffffffff } , table: enum } , distance: num [1 .. 255] } , table: alt { table-default: enum (default) { default:0xffffffff } , table: enum } } } | 要添加默认路由的路由表,格式为 table 或 table:distance 条目。default 是主路由表;当客户端接口属于 VRF 时,则是该 VRF 路由表。默认值:default。 |
check-gateway | enum (none | arp | ping | bfd) | 客户端添加的默认路由上设置的网关检查(none、arp、ping 或 bfd),因此该路由仅在其网关响应时使用。默认值:none。 |
use-peer-dns | bool | 是否接受 DHCPv6 服务器通告的 DNS 服务器。默认值:yes。 |
use-interface-duid | bool | 是否使用由客户端接口 MAC 地址生成的 DUID,而不是路由器的其他 DHCPv6 客户端及其 DHCPv6 服务器所使用的路由器 DUID。默认值:no。 |
custom-duid | string | 要发送的 DUID,代替生成的 DUID,十六进制形式,例如 0x0003000102aabbccddee。覆盖 use-interface-duid。 |
validate-server-duid | bool | 是否检查 DHCPv6 服务器发送的 DUID 格式是否正确。使用 no 时,会接受格式不正确的服务器 DUID,但仍会检查其最小长度。默认值:yes。 |
rapid-commit | bool | 是否使用 Rapid Commit 选项请求两消息交换(Solicit 和 Reply)。如果服务器不使用它,或设置为 no,则使用四消息交换(Solicit、Advertise、Request、Reply)。默认值:yes。 |
allow-reconfigure | bool | 是否接受来自 DHCPv6 服务器的 Reconfigure 消息。启用后,客户端在其 Solicit 中声明这一点,接收 reconfigure 密钥,并在服务器发送 Reconfigure 消息时立即续订。RouterOS DHCPv6 服务器在其设置更改时以及通过绑定的 send-reconfigure 命令发送 Reconfigure 消息。默认值:no。 |
dhcp-options | multi { array-id, option: enum } | 客户端发送的选项,从 /ipv6/dhcp-client/option 按名称选择。预定义的 fqdn 选项将路由器身份作为客户端的 FQDN(选项 39)发送。默认值:fqdn。 |
pool-name | string | 客户端根据收到前缀创建动态 IPv6 池的名称,可将地址从该池分配给其他接口。池的生存期跟随前缀,并在每次续订时延长。仅在请求前缀时应用。 |
pool-prefix-length | num | 池分配的前缀长度,例如 64。它必须等于或长于收到前缀。未设置时,长度自动选择,例如收到 /56 时为 64。仅在请求前缀时应用。 |
prefix-hint | ip6Prefix | 要向服务器建议的前缀或前缀长度,例如 ::/60 请求 /60。服务器不必遵循。::/0 不发送提示。默认值:::/0。 |
prefix-address-lists | multi { array-id, prefix-address-list: string } | 收到的前缀要作为动态条目添加到的 IPv6 防火墙地址列表。仅在请求前缀时应用。 |
script | alt { script: string } | 客户端获得、续订或丢失地址或前缀时运行的脚本。它分别针对前缀和地址运行,并接收以下变量: - pd-valid - 获得前缀时为 1,丢失时为 0;与地址有关时为空。 - pd-prefix - 前缀及其长度。 - na-valid - 获得地址时为 1,丢失时为 0;与前缀有关时为空。 - na-address - 地址。 - options - 从服务器收到的选项数组,按选项代码索引。 |
custom-iapd-id | num | 用于前缀请求(IA_PD)的标识关联标识符(IAID),代替从客户端接口派生的值。 |
custom-iana-id | num | 用于地址请求(IA_NA)的标识关联标识符(IAID),代替从客户端接口派生的值。 |
| 只读参数 | 类型 | 描述 |
|---|---|---|
status | enum (stopped | searching... | requesting... | bound | renewing... | rebinding... | stopping... | declining... | error | idle | requesting-info... | confirming...) | 客户端当前状态: - searching... - 发送 Solicit 消息并等待服务器。 - requesting... - 请求提供的地址或前缀。 - bound - 客户端拥有其地址或前缀。 - renewing... - 向提供地址或前缀的服务器续订。 - rebinding... - 服务器未应答续订;向任意服务器请求。 - requesting-info... - 等待 Information-request 的回复(request=info)。 - idle - Information-request 已应答(request=info)。 - confirming... - 向服务器确认地址或前缀对该链路仍然有效。 - declining... - 拒绝地址。 - stopping... - 发送 Release 消息。 - stopped - 客户端已禁用。 - error - 客户端无法运行。 |
duid | string | 客户端发送的 DUID。 |
dhcp-server-v6 | ip6Addr | 服务器回复来自的地址,通常是 DHCPv6 服务器的链路本地地址。 |
prefix | composite { prefix: ip6Prefix , expires-after: time } | 收到的前缀及其过期前的时间。 |
address | composite { address: ip6Addr , expires-after: time } | 收到的地址及其过期前的时间。 |
reconfigure-key | string | 从 DHCPv6 服务器收到的密钥,用于验证其 Reconfigure 消息。仅在启用 allow-reconfigure 时设置。 |
reconfigure-last-counter | string | 从 DHCPv6 服务器接受的最后一条 Reconfigure 消息的重放检测计数器。它随每条 Reconfigure 消息递增。 |