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

dhcp: add options for static leases, custom domain names and olsrd services #524

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Noki
Copy link
Member

@Noki Noki commented Aug 6, 2023

This allows to add static dhcp leases, custom domain names and olsrd services by adding a dhcp.yml / olsrd.yml file to the location directory. This would resolve #265.

The syntax of the dhcp.yml file is as follows:

---
dhcp_static_leases:
- name: hostname1
  mac: AA:BB:80:7C:E8:9E
  ip: 10.10.10.1
- name: unifi
  mac: AA:BB:80:7C:E8:99
  ip: 10.10.10.2
  dns: 1
- name: webcam1
  mac: AA:BB:80:7C:E8:01
  ip: 10.10.10.3
  dns: 1
  olsrd_nameservice: 1
- name: webcam2
  mac: AA:BB:80:7C:E8:02
  ip: 10.10.10.4
  dns: 1
  olsrd_nameservice: 1  
dhcp_custom_domain_names:
- name: unifi
  ip: 10.10.10.2

The syntax of the olsrd.yml file is as follows:

---
olsrd_services:
- name: Webcam 1
  protocol: tcp
  url: http://webcam1.olsr:80/
- name: Webcam 2
  protocol: tcp
  url: http://webcam2.olsr:80/  

This still misses documentation in the commit. Feedback is welcome.

Todo:

  • check that olsrd_services fields do not contain a pipe "|"
  • add proper documentation
  • resolve TODO in roles/cfg_openwrt/templates/corerouter/config/dhcp.j2
  • resolve TODO in roles/cfg_openwrt/templates/corerouter/config/olsrd.j2
  • also apply changes to roles/cfg_openwrt/templates/gateway/config/*

@Noki Noki requested a review from pmelange August 6, 2023 13:34
@Noki Noki marked this pull request as draft August 6, 2023 13:34
@Noki Noki force-pushed the dhcp-config branch 3 times, most recently from 47a8f99 to aad606a Compare August 7, 2023 09:52
@Noki Noki changed the title dhcp: add options for static leases and custom domain names dhcp: add options for static leases, custom domain names and olsrd services Aug 7, 2023
Copy link
Member

@Akira25 Akira25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me at a short wentthrough.

One notice on the OLRS-services:
Hence the service name field has a flexible string, there are a lot of letters, which are not allowed to be there. Otherwise they will stop the olsrd from start up.

For an exact list of them, refer to the service-registrar sanitize code please.

As bbb-configs is an expert toop, it should be enough, to mention that circumstance in the documentation.

@Noki
Copy link
Member Author

Noki commented Aug 8, 2023

I added validation for the olsrd services fields to avoid having an olsrd service that is not starting.

@Noki Noki force-pushed the dhcp-config branch 2 times, most recently from 0a888f5 to b9cc657 Compare August 12, 2023 14:39
@Noki
Copy link
Member Author

Noki commented Aug 12, 2023

I added documentation. I would love to get some more feedback on this / active testing.

@Noki Noki marked this pull request as ready for review August 12, 2023 14:54
@pmelange
Copy link
Contributor

I know it's not in your code, but

is causing problems. It should be config domain

Also, for my setup, I would prefer to limit the range of IPs on the dhcp network. For example, I have it set up so that the start is 50 and the limit is 200. I use the first 50 addresses for static leases and statically configured hosts (for prototyping and VM's).

@pmelange
Copy link
Contributor

These changes should also be done in templates/gateway/config/ too.

DEVELOPER.md Outdated Show resolved Hide resolved
DEVELOPER.md Outdated Show resolved Hide resolved
DEVELOPER.md Outdated Show resolved Hide resolved
@Noki Noki marked this pull request as draft September 18, 2023 16:07
@pmelange
Copy link
Contributor

These changes should also be done in templates/gateway/config/ too.

I still don't see any changes in templates/gateway/config/

@Noki
Copy link
Member Author

Noki commented Sep 19, 2023

Yes, not done yet... added all open tasks to the todo list of this PR (first post).

@pktpls
Copy link
Contributor

pktpls commented Jul 11, 2024

Was ist hier der aktuelle Stand

@Noki
Copy link
Member Author

Noki commented Jul 11, 2024

Der aktuelle Stand ist, dass es eigentlich erst sinnvoll ist dies fertig zu machen, wenn wir alle Geräte als Hosts beschreiben, also auch Antennen und Switches und die SNMP Profiles, DFS-Reset und eben auch services und leases dann auf die Hostbeschreibung wechseln. - So war zumindest mal der Plan den ich mit @FFHener besprochen hatte.

@FFHener
Copy link
Contributor

FFHener commented Jul 11, 2024

Ich hab die Arbeit an dieser Migration dahin aktuell pausiert um die Sommermonate mich auf die Wartung zu fokussieren, würde aber nach meiner aktuellen Planung in das Thema wieder im Herbst einsteigen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to define extra "domain" entries in /etc/config/dhcp
5 participants