Skip to content

Dhcpcd ipv6 support#102

Merged
JedMeister merged 7 commits intoturnkeylinux:masterfrom
JedMeister:dhcpcd-ipv6-support
Apr 15, 2026
Merged

Dhcpcd ipv6 support#102
JedMeister merged 7 commits intoturnkeylinux:masterfrom
JedMeister:dhcpcd-ipv6-support

Conversation

@JedMeister
Copy link
Copy Markdown
Member

@JedMeister JedMeister commented Apr 10, 2026

Copy of @marcos-mendez's #101 PR - see that for full details of the IPv6 update.

This PR:

  • amends the last commit to update the gitgnore file and remove build assets (that will now be ignored post the updated gitignore).
  • increases the default size of the window for nicer display of ipv6 addresses
  • reformats the text to get it all on the one screen where possible.

PopSolutions and others added 6 commits March 24, 2026 16:44
- ifutil.py: Add retry loop (10s timeout) in set_dhcp() for non-blocking
  DHCP clients like dhcpcd. The previous code checked for an IP address
  immediately after ifup returned, but dhcpcd forks and assigns the
  address asynchronously (~3s delay).

- ifutil.py: Add get_ipv6conf() to retrieve global-scope IPv6 address
  and prefix length via 'ip -6 addr show'.

- confconsole.py: Display IPv6 address in both the main services screen
  and the networking configuration screen when available.

Tested on Proxmox LXC unprivileged container (Moodle v19, Trixie)
with dhcpcd as the sole DHCP client (dual-stack DHCPv4/DHCPv6).
_get_default_nic() only checked IPv4 via get_ipconf(), causing
confconsole to report 'Networking is not yet configured' on
IPv6-only hosts despite having a valid global address.

Add get_ipv6conf() fallback in _validip(): if no valid IPv4 is
found, check for a global-scope IPv6 address before declaring
the interface unconfigured.

This enables IPv6-first deployments to pass the network check
without requiring an IPv4 address.
Pass IPv6 address as $ip6addr to services.txt template instead of
appending it after substitution. Uses safe_substitute so appliances
without $ip6addr in their services.txt are unaffected.

Ref: turnkeylinux/tracker#1658
@JedMeister JedMeister requested a review from OnGle April 14, 2026 04:51
@JedMeister
Copy link
Copy Markdown
Member Author

Let me know what you think @OnGle

Copy link
Copy Markdown
Member

@marcos-mendez marcos-mendez left a comment

Choose a reason for hiding this comment

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

Sorry got a litttle messy my comment but here it is

@JedMeister
Copy link
Copy Markdown
Member Author

Thanks @marcos-mendez 😁

Looking closer it's called 4 times...!

First @ 334 in _get_default_nic()
Then @ 444 in _get_ifconftext()
Then twice in usage() as you noted.

I've removed that last one and moved hostname = netinfo.get_hostname().upper() below it - so all the IP stuff is together.

TBH I think now we're making ipv6 a "first class citizen" refactoring the whole layout would be nice. As an aside, @OnGle & I have often talked about possibly ditching dialog altogether. But all of that's for another day...

@JedMeister
Copy link
Copy Markdown
Member Author

FYI I've just packaged this and pushed it to the TKL trixie-testing apt repo - it's version 2.2.0rc3+7+gd67ab42.

Copy link
Copy Markdown
Member

@OnGle OnGle 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!

@JedMeister JedMeister merged commit 0936cd7 into turnkeylinux:master Apr 15, 2026
@JedMeister JedMeister deleted the dhcpcd-ipv6-support branch April 15, 2026 03:02
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.

3 participants