Skip to content

[client] Add IPv6 dual-stack support#148

Open
lixmal wants to merge 2 commits intomainfrom
feature/ipv6-support
Open

[client] Add IPv6 dual-stack support#148
lixmal wants to merge 2 commits intomainfrom
feature/ipv6-support

Conversation

@lixmal
Copy link
Copy Markdown
Contributor

@lixmal lixmal commented Mar 30, 2026

Add IPv6 dual-stack support to the Android client.

  • Expand TunAdapter.ConfigureInterface to accept an IPv6 address and add it to the VPN builder
  • Display peer IPv6 addresses in the peer list with a copy-to-clipboard option
  • Add a "Disable IPv6" toggle in Advanced settings
  • Point netbird submodule to the IPv6 branch

Summary by CodeRabbit

Release Notes

  • New Features
    • Added IPv6 support throughout the app, including peer IPv6 address display and clipboard copy functionality.
    • Added option in Advanced Settings to disable IPv6 overlay addressing on the tunnel interface.
    • Enhanced exit node detection to properly identify both IPv4 and IPv6 routes.
    • Added TV remote support for IPv6 disable toggle.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

Warning

Rate limit exceeded

@lixmal has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 21 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 14 minutes and 21 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5c4ee226-a6be-490c-bfb3-8b88aec64d96

📥 Commits

Reviewing files that changed from the base of the PR and between 3f573e8 and 297b618.

📒 Files selected for processing (1)
  • app/src/main/java/io/netbird/client/ui/home/Resource.java
📝 Walkthrough

Walkthrough

This PR adds IPv6 support throughout the NetBird Android client, enabling users to configure IPv6 on tunnel interfaces, view IPv6 addresses in peer lists, and copy IPv6 addresses to clipboard. Changes span UI configuration, peer data modeling, network interface setup, and submodule dependency updates.

Changes

Cohort / File(s) Summary
Advanced Settings UI
app/src/main/java/io/netbird/client/ui/advanced/AdvancedFragment.java, app/src/main/res/layout/fragment_advanced.xml, app/src/main/res/values/strings.xml
Added disable IPv6 setting to advanced engine configuration with UI switch, persistence via goPreferences, error logging, and TV-remote support.
Peer Model and Display
app/src/main/java/io/netbird/client/ui/home/Peer.java, app/src/main/java/io/netbird/client/ui/home/PeersAdapter.java, app/src/main/java/io/netbird/client/ui/home/PeersFragmentViewModel.java
Extended Peer class with IPv6 field and getter; updated adapter to display IPv6 alongside IPv4 and added clipboard menu item for copying IPv6 addresses.
Network Resource Detection
app/src/main/java/io/netbird/client/ui/home/Resource.java
Updated isExitNode() to recognize both IPv4 (0.0.0.0/0) and IPv6 (::/0) CIDR notation as exit node indicators.
VPN Interface Configuration
tool/src/main/java/io/netbird/client/tool/IFace.java, tool/src/main/java/io/netbird/client/tool/TUNParameters.java, tool/src/main/java/io/netbird/client/tool/NetworkChangeNotifier.java, tool/src/main/java/io/netbird/client/tool/VPNService.java
Extended tunnel creation pipeline to accept and configure IPv6 addresses; added addressV6 parameter to TUNParameters, updated configureInterface signature, and added setInterfaceIPv6 override.
Clipboard Menu
app/src/main/res/menu/peer_clipboard_menu.xml
Added menu item for copying IPv6 addresses to clipboard.
Dependencies
netbird (git submodule)
Updated netbird submodule commit reference.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • doromaraujo

Poem

🐰 IPv6 hops through the tunnel so bright,
Addresses flowing in pairs of delight!
From settings to peers, the addresses shine,
A clipboard full of addresses so fine! 📋✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[client] Add IPv6 dual-stack support' directly and clearly summarizes the main objective of the pull request, which is to add IPv6 dual-stack support to the Android client.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/ipv6-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lixmal lixmal force-pushed the feature/ipv6-support branch from fa435ce to 3f573e8 Compare March 30, 2026 17:38
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/main/java/io/netbird/client/ui/home/Resource.java`:
- Around line 38-40: The isExitNode method in class Resource can NPE and misses
IPv6 when multiple addresses are present; update Resource.isExitNode to be
null-safe and use the same containment logic for both IPv4 and IPv6 (e.g., check
address != null and then address.contains("0.0.0.0/0") ||
address.contains("::/0")) so both "0.0.0.0/0,::/0" and "::/0,10.0.0.0/8" are
detected consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 07976be7-06ad-4c85-aeb7-69281ce165ee

📥 Commits

Reviewing files that changed from the base of the PR and between f7e1c65 and 3f573e8.

📒 Files selected for processing (13)
  • app/src/main/java/io/netbird/client/ui/advanced/AdvancedFragment.java
  • app/src/main/java/io/netbird/client/ui/home/Peer.java
  • app/src/main/java/io/netbird/client/ui/home/PeersAdapter.java
  • app/src/main/java/io/netbird/client/ui/home/PeersFragmentViewModel.java
  • app/src/main/java/io/netbird/client/ui/home/Resource.java
  • app/src/main/res/layout/fragment_advanced.xml
  • app/src/main/res/menu/peer_clipboard_menu.xml
  • app/src/main/res/values/strings.xml
  • netbird
  • tool/src/main/java/io/netbird/client/tool/IFace.java
  • tool/src/main/java/io/netbird/client/tool/NetworkChangeNotifier.java
  • tool/src/main/java/io/netbird/client/tool/TUNParameters.java
  • tool/src/main/java/io/netbird/client/tool/VPNService.java

Use contains() for IPv6 check to match IPv4 logic, so multi-address
strings like "0.0.0.0/0,::/0" are handled correctly. Add null guard
for address field.
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.

1 participant