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

T2958: Refactor DHCP-server systemd unit and lease #2184

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

sever-sever
Copy link
Member

@sever-sever sever-sever commented Aug 29, 2023

Change Summary

Render isc-dhcp-server systemd unit from configuration

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

dhcp-server

Proposed changes

How to test

set service dhcp-server shared-network-name NET authoritative
set service dhcp-server shared-network-name NET subnet 192.0.2.0/24 range RANG01 start 192.0.2.10
set service dhcp-server shared-network-name NET subnet 192.0.2.0/24 range RANG01 stop 192.0.2.130
set service dhcp-server shared-network-name NET subnet 192.0.2.0/24 default-router 192.0.2.1

Check leases in /run directory

vyos@vyos:~$ cat /run/dhcp-server/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.4.3-P1

# authoring-byte-order entry is generated, DO NOT DELETE
authoring-byte-order little-endian;

server-duid "\000\001\000\001,\200{6RT\000\311\275\205";

lease 192.0.2.10 {
  starts 2 2023/08/29 09:49:01;
  ends 3 2023/08/30 09:49:01;
  cltt 2 2023/08/29 09:49:01;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 52:54:00:92:35:5d;
  set shared-networkname = "NET";
  client-hostname "r1";
}
lease 192.0.2.11 {
  starts 2 2023/08/29 09:55:09;
  ends 3 2023/08/30 09:55:09;
  cltt 2 2023/08/29 09:55:09;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 52:54:00:04:33:2b;
  set shared-networkname = "NET";
  client-hostname "r14";
}

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro and c-po and removed request for a team August 29, 2023 10:06
@sever-sever
Copy link
Member Author

Or we can just create the “/config” directory

@sarthurdev
Copy link
Member

Or we can just create the “/config” directory

I suppose this would be best. No further proceessing needed in conf script. Though a warning might be needed to state the contents is not retained.

Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

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

I like the dehardcoding of the file name, but I also disagree with adding a fixup. The live CD environment should not be different from the installed environment, we need to find out why /config is not created and create it.

@jestabro
Copy link
Contributor

I am looking into some related matters, regarding /config and live-boot; I'll add an update should it reveal anything useful ...

@sever-sever
Copy link
Member Author

Another solution vyos/vyos-build#383

@c-po
Copy link
Member

c-po commented Aug 31, 2023

I'm in favour of vyos/vyos-build#383

@sarthurdev
Copy link
Member

With vyos/vyos-build#383 merged, suppose this can be closed?

@sever-sever
Copy link
Member Author

With vyos/vyos-build#383 merged, suppose this can be closed?

We agree to rewrite part of this and delete lease related configuration, other looks good.
Will do soon.

Render isc-dhcp-server systemd unit from configuration
@sever-sever sever-sever changed the title T2958: Ability to start DHCP-server from LiveCD T2958: Refactor DHCP-server systemd unit and lease Sep 4, 2023
@c-po c-po merged commit 487c817 into vyos:current Sep 5, 2023
6 of 7 checks passed
@sarthurdev
Copy link
Member

Will this cause any problems with the lease file no longer being persistent across reboots?

@sever-sever
Copy link
Member Author

sever-sever commented Sep 5, 2023

Will this cause any problems with the lease file no longer being persistent across reboots?

Sure, there should be /config/dhcpd.leases
It seems I deleted the wrong path variable for leases :)
Fix #2203

@sever-sever sever-sever deleted the T2958 branch September 5, 2023 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants