Skip to content

Conversation

@cpcowart
Copy link
Contributor

@cpcowart cpcowart commented Dec 7, 2025

The renew command will refuse to restart the dhcp6c process for an interface unless it is configured to request an address, but the client may also be running to manage parameters and/or prefix delegations.

Change summary

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)

T8078

Related PR(s)

N/A

How to test / Smoketest result

Before:

set interfaces ethernet eth0 address 'dhcp'
set interfaces ethernet eth0 dhcpv6-options parameters-only
set interfaces ethernet eth0 dhcpv6-options pd 0 interface dum4 address '1'
set interfaces ethernet eth0 dhcpv6-options pd 0 interface dum4 sla-id '5'
set interfaces ethernet eth0 dhcpv6-options pd 0 length '56'
set interfaces ethernet eth0 dhcpv6-options rapid-commit
set interfaces ethernet eth0 ipv6 address autoconf

$ renew dhcpv6 interface eth0 
DHCPv6 client not configured on interface eth0!

After:

vyos@vyos:~$ renew dhcpv6 interface eth0
Restarting DHCPv6 client on interface eth0...

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

@github-actions
Copy link

github-actions bot commented Dec 7, 2025

👍
No issues in PR Title / Commit Title

@sever-sever sever-sever requested review from c-po, dmbaturin and sarthurdev and removed request for c-po December 8, 2025 08:25
@c-po c-po added bp/sagitta Create automatic backport for sagitta LTS version bp/circinus Create automatic backport for circinus labels Dec 8, 2025
@cpcowart cpcowart force-pushed the cc/fix-dhcpv6-renew-gate branch from 0fcf6d3 to 40c84ef Compare December 10, 2025 06:51
The renew command will refuse to restart the dhcp6c process for an
interface unless it is configured to request an address, but the
client may also be running to manage parameters and/or prefix
delegations.
@cpcowart cpcowart force-pushed the cc/fix-dhcpv6-renew-gate branch from 40c84ef to 3ae47d8 Compare December 10, 2025 06:55
@github-actions
Copy link

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests (no interfaces) 👍 passed
  • CLI Smoketests VPP 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • Config tests VPP 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

@cpcowart cpcowart requested a review from c-po December 10, 2025 16:58
family = kwargs.get('family')
v = 'v6' if family == 'inet6' else ''
interface = kwargs.get('interface')
interface_path = Section.get_config_path(interface)
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if Section.get_config_path(interface) should return a list instead, as we mostly work with lists - but this is another discussion.

Copy link
Member

@c-po c-po left a comment

Choose a reason for hiding this comment

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

Implementation looks good. Manually tested:

DHCPv6 server:

set interfaces ethernet eth0 vif 666 address '2001:db8::1/64'
set service router-advert interface eth0.666 prefix ::/64
set service dhcpv6-server shared-network-name foo subnet 2001:db8::/64 prefix-delegation start 2001:db8:1000:: prefix-length '56'
set service dhcpv6-server shared-network-name foo subnet 2001:db8::/64 prefix-delegation start 2001:db8:1000:: stop '2001:db8:1fff::'

DHCPv6 client:

set interfaces ethernet eth0 vif 666 dhcpv6-options pd 0 interface dum20 address '1'
set interfaces ethernet eth0 vif 666 dhcpv6-options rapid-commit
set interfaces ethernet eth0 vif 666 ipv6 address autoconf
set interfaces dummy dum20

results in

[email protected]# run show interfaces dummy dum20
dum20: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether 7e:cd:da:fd:85:6e brd ff:ff:ff:ff:ff:ff
    inet6 2001:db8:1fff::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::7ccd:daff:fefd:856e/64 scope link
       valid_lft forever preferred_lft forever

Now renewing the DHCPv6 lease:

[email protected]# run renew dhcpv6 interface eth0.666
Restarting DHCPv6 client on interface eth0.666...

renews the lease on the server

Dec 10 21:18:48 dhcpd[10648]: Release message from fe80::250:56ff:febf:c56d port 546, transaction ID 0x384E2000
Dec 10 21:18:48 dhcpd[10648]: Client 00:04:42:3f:67:73:77:df:c4:80:42:c9:42:af:ff:15:de:0b releases prefix 2001:db8:1fff::/56
Dec 10 21:18:48 dhcpd[10648]: Sending Reply to fe80::250:56ff:febf:c56d port 546
Dec 10 21:18:48 dhcpd[10648]: Solicit message from fe80::250:56ff:febf:c56d port 546, transaction ID 0x5941EF00
Dec 10 21:18:48 dhcpd[10648]: Picking pool prefix 2001:db8:1fff::/56
Dec 10 21:18:48 dhcpd[10648]: Advertise PD: address 2001:db8:1fff::/56 to client with duid 00:04:42:3f:67:73:77:df:c4:80:42:c9:42:af:ff:15:de:0b iaid = 0 valid for 4294967295 seconds
Dec 10 21:18:48 dhcpd[10648]: Sending Advertise to fe80::250:56ff:febf:c56d port 546
Dec 10 21:18:49 dhcpd[10648]: Request message from fe80::250:56ff:febf:c56d port 546, transaction ID 0x38F1D00
Dec 10 21:18:49 dhcpd[10648]: Reply PD: address 2001:db8:1fff::/56 to client with duid 00:04:42:3f:67:73:77:df:c4:80:42:c9:42:af:ff:15:de:0b iaid = 0 valid for 4294967295 seconds
Dec 10 21:18:49 dhcpd[10648]: Sending Reply to fe80::250:56ff:febf:c56d port 546

@c-po c-po requested a review from sever-sever December 10, 2025 20:20
Copy link
Member

@sever-sever sever-sever left a comment

Choose a reason for hiding this comment

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

Allow to renew DHCPv6 lease without IPv6 address in cases prefix/deletegation or option parameters only.
The usecase described in the PR and task. Tested by @c-po

@sever-sever sever-sever merged commit 7816910 into vyos:current Dec 11, 2025
18 checks passed
@vyosbot vyosbot added mirror-initiated This PR initiated for mirror sync workflow mirror-completed and removed mirror-initiated This PR initiated for mirror sync workflow labels Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bp/circinus Create automatic backport for circinus bp/sagitta Create automatic backport for sagitta LTS version current mirror-completed

Development

Successfully merging this pull request may close these issues.

4 participants