Module netlink.rt.route

Kernel routing table interface.

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

See also:

Class route

route:add (opts) Adds a route to the kernel routing table.
route:del (opts) Deletes a route from the kernel routing table.
route:list ([family=AF_UNSPEC]) Lists all routes from the kernel routing tables.
route:new ([o]) Creates a new route object.


Class route

route:add (opts)
Adds a route to the kernel routing table.

Parameters:

  • opts table route parameters: optional family (default AF_INET), dst_len, dst, gateway, oif, table, protocol, scope, rtype.
route:del (opts)
Deletes a route from the kernel routing table.

Parameters:

  • opts table route parameters: optional family (default AF_INET), dst_len, dst, oif, table.
route:list ([family=AF_UNSPEC])
Lists all routes from the kernel routing tables.

Parameters:

  • family integer address family. (default AF_UNSPEC)

Returns:

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

Parameters:

  • o table an initial object table. (optional)

Returns:

    route the new route object.

See also:

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