镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

DHCP client with option 121/249 and route table #5

Closed

Description

@compot-dev

Addresses and routes are obtained via DHCP through the tunnel (see README → Addressing).

  • Enable lwIP dhcp.c; chaddr and client-id (61, type 1) from the device ID.
  • Parse option 121 (RFC 3442) and 249 via LWIP_HOOK_DHCP_PARSE_OPTION; request 1, 3, 6, 28, 121, 249 in option 55.
  • Route table: connected subnet + classless routes; ignore option 3 when 121 is present (RFC 3442) → no default route via the tunnel; debug setting to use option 3 as default route (off by default).
  • First DHCP timeout ≥ 4–5 s (server ARP ping-check delays the offer by ~3 s), retries.
  • Infinite leases supported; renew/rebind for finite leases.
  • No DHCPRELEASE on tunnel loss; request the previous address after reconnect.
  • Event "address bound" / "no DHCP address"; proxy rejects connections until bound.
  • Unit tests for 121 parsing: /0, /8, /24, /32, multiple routes, truncated data.

Activity

  1. compot-dev commented on Oct 13, 2026

    @compot-dev
    CollaboratorAuthor

    Progress (c12bda6): lwIP DHCP with options 121/249 requested (DHCP_ADD_EXTRA_REQUEST_OPTIONS), parsed in LWIP_HOOK_DHCP_PARSE_OPTION and applied on bind; RFC 3442 (option 3 ignored with 121); routing via LWIP_HOOK_IP4_ROUTE_SRC / LWIP_HOOK_ETHARP_GET_GW; same address after reconnect (INIT-REBOOT). Verified on the bench and on the target server (address + 3 classless routes).

    Open: client-id (option 61) is not sent — lwIP uses chaddr only, which the target server accepts; renew/rebind tests with finite leases; proxy-side rejection before bind (#10).

  2. compot-dev commented on Oct 14, 2026

    @compot-dev
    CollaboratorAuthor

    All items are done (c12bda6): DHCP through the tunnel, options 121/249 requested and parsed, RFC 3442 (option 3 ignored with 121), routing, longer first timeout, infinite leases, no release on tunnel loss and the previous address after reconnect, proxy refuses until bound, unit tests. Verified on the bench (cli-test, tap-test) and on a production VTun 3.0.2 server. Option 61 is deliberately not sent (chaddr is the device ID; documented in docs/usage.md). Renew/rebind tests with finite leases moved to #9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage-1CLI prototype (TCP, ether, DHCP)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions