Module netlink.rt.rule

FIB rule (policy routing) interface.

A netlink.session specialization over the NETLINK_ROUTE protocol: create an instance with netlink.rt.rule(), then add, delete and list FIB rules; the underlying socket is closed by close() (or the to-be-closed __close). All methods block and require a sleepable runtime.

See also:

Class rule

rule:add (opts) Adds a FIB rule directing matching lookups to a routing table.
rule:del (opts) Deletes a FIB rule matching the given parameters.
rule:list ([family=AF_UNSPEC]) Lists all FIB rules from the kernel.
rule:new ([o]) Creates a new rule object.


Class rule

rule:add (opts)
Adds a FIB rule directing matching lookups to a routing table.

Parameters:

  • opts table rule parameters: optional family (default AF_INET), table, priority, fwmark, protocol, action (default FR_ACT_TO_TBL).
rule:del (opts)
Deletes a FIB rule matching the given parameters.

Parameters:

  • opts table rule parameters: optional family (default AF_INET), table, priority, fwmark.
rule:list ([family=AF_UNSPEC])
Lists all FIB rules from the kernel.

Parameters:

  • family integer address family. (default AF_UNSPEC)

Returns:

    table list of rule tables.
rule:new ([o])
Creates a new rule object.

Parameters:

  • o table an initial object table. (optional)

Returns:

    rule the new rule object.

See also:

generated by LDoc 1.5.0 Last updated 2026-09-05 12:27:44