Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic DHCP server support #703

Open
troglobit opened this issue Oct 11, 2024 · 0 comments · May be fixed by #887
Open

Basic DHCP server support #703

troglobit opened this issue Oct 11, 2024 · 0 comments · May be fixed by #887
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@troglobit
Copy link
Contributor

troglobit commented Oct 11, 2024

Introduction

This task is a subset of issue #446, detailing requirements for a Basic DHCP Server which can later be expanded upon, without major rewrites or breaking configuration file syntax changes.

Note: this does not include support for acting as a DHCP relay.

Requirements (subset of #446)

  1. The server implementation should1 be dnsmasq, since it is already acting as system name resolver with openresolv, and can also act as TFTP (and PXE) server
  2. Must be possible to set up an IP address pool without an interface
  3. All DHCP options must be generalized, without exception
    • Common settings, that many vendors have dedicated settings for, like "default router", "dns server", should be managed as DHCP options instead
    • Configuring from the CLI should infer2 the dnsmasq default (sensible) options: netmask (option 1), broadcast address (option 28), DNS server (option 6), default route (option 3), domain name (option 15)
    • When configuring from any other source (NETCONF/RESTCONF), the user must know of these defaults from the YANG model description
    • An empty option list should tell dnsmasq to send no options
  4. Support static host leases
    • Support matching on MAC address, client-id option, and make it possible (future) to add Option 82 sub-options without causing syntax changes for the former two match options
  5. Use common vernacular in the YANG model (see Add support for DHCP server #446)

Proposed YANG model (tree view)

$ yanglint -f tree -p ../src/infix/output/target/usr/share/yang/ infix-dhcp-server.yang
module: infix-dhcp-server
  +--rw dhcp-server
     +--rw enabled?      boolean
     +--rw option* [key]
     |  +--rw key         dhcp-server-options
     |  +--rw (optval)?
     |     +--:(address)
     |     |  +--rw address?   inet:ipv4-address
     |     +--:(name)
     |     |  +--rw name?   inet:domain-name
     |     +--:(classless-routes)
     |     |  +--rw static-route* [destination]
     |     |     +--rw destination    inet:ipv4-prefix
     |     |     +--rw next-hop?      inet:ipv4-address
     |     +--:(default-opt)
     |        +--rw value?   string
     +--rw subnet* [subnet]
     |  +--rw subnet         inet:ipv4-prefix
     |  +--rw description?   string
     |  +--rw if-name?       if:interface-ref
     |  +--rw option* [key]
     |  |  +--rw key         dhcp-server-options
     |  |  +--rw (optval)?
     |  |     +--:(address)
     |  |     |  +--rw address?   inet:ipv4-address
     |  |     +--:(name)
     |  |     |  +--rw name?   inet:domain-name
     |  |     +--:(classless-routes)
     |  |     |  +--rw static-route* [destination]
     |  |     |     +--rw destination    inet:ipv4-prefix
     |  |     |     +--rw next-hop?      inet:ipv4-address
     |  |     +--:(default-opt)
     |  |        +--rw value?   string
     |  +--rw pool
     |  |  +--rw start-address?   inet:ipv4-address
     |  |  +--rw end-address?     inet:ipv4-address
     |  |  +--rw lease-time?      dhcp-lease-time
     |  +--rw host* [address]
     |  |  +--rw address        inet:ipv4-address
     |  |  +--rw description?   string
     |  |  +--rw match
     |  |  |  +--rw (match)?
     |  |  |     +--:(mac-address)
     |  |  |     |  +--rw mac-address?   yang:mac-address
     |  |  |     +--:(hostname)
     |  |  |     |  +--rw hostname?   string
     |  |  |     +--:(client-id)
     |  |  |        +--rw client-id?   union
     |  |  +--rw hostname?      inet:domain-name
     |  |  +--rw lease-time?    dhcp-lease-time
     |  |  +--rw option* [key]
     |  |     +--rw key         dhcp-server-options
     |  |     +--rw (optval)?
     |  |        +--:(address)
     |  |        |  +--rw address?   inet:ipv4-address
     |  |        +--:(name)
     |  |        |  +--rw name?   inet:domain-name
     |  |        +--:(classless-routes)
     |  |        |  +--rw static-route* [destination]
     |  |        |     +--rw destination    inet:ipv4-prefix
     |  |        |     +--rw next-hop?      inet:ipv4-address
     |  |        +--:(default-opt)
     |  |           +--rw value?   string
     |  +--ro leases
     |     +--ro total-count?   uint32
     |     +--ro lease* [address]
     |        +--ro address              inet:ip-address
     |        +--ro hardware-address?    yang:mac-address
     |        +--ro hostname?            string
     |        +--ro expires?             yang:date-and-time
     |        +--ro client-identifier?   string
     +--ro statistics
        +--ro sent
        |  +--ro offer-count?   yang:counter32
        |  +--ro ack-count?     yang:counter32
        |  +--ro nack-count?    yang:counter32
        +--ro received
        |  +--ro decline-count?    yang:counter32
        |  +--ro discover-count?   yang:counter32
        |  +--ro request-count?    yang:counter32
        |  +--ro release-count?    yang:counter32
        |  +--ro inform-count?     yang:counter32
        +---x clear

Footnotes

  1. RFC2119 applies.

  2. I.e., employ the use of SR_EV_UPDATE when changes to the candidate datastore happen.

@troglobit troglobit changed the title Basic DCHP server support Basic DHCP server support Oct 11, 2024
@troglobit troglobit added enhancement New feature or request triage Pending investigation & classification (CCB) labels Oct 18, 2024
@troglobit troglobit removed the triage Pending investigation & classification (CCB) label Oct 31, 2024
@troglobit troglobit added this to the FUTURE milestone Oct 31, 2024
@troglobit troglobit linked a pull request Jan 14, 2025 that will close this issue
17 tasks
@troglobit troglobit modified the milestones: FUTURE, Infix v25.01 Jan 14, 2025
@troglobit troglobit self-assigned this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant