Fix: Replace 'pref' with 'priority' in ip rule for Android compatibility#21
Open
frendhisaido wants to merge 1 commit intoeventlOwOp:masterfrom
Open
Fix: Replace 'pref' with 'priority' in ip rule for Android compatibility#21frendhisaido wants to merge 1 commit intoeventlOwOp:masterfrom
frendhisaido wants to merge 1 commit intoeventlOwOp:masterfrom
Conversation
…ompatibility The 'pref' keyword is not supported by Android's ip command, causing routing rules to fail silently on boot. This prevented ZeroTier traffic from being routed through the ztyg2zjccj interface on Android 14+ devices. Changed 'pref 1' to 'priority 1' in lib.sh __start() function to ensure main routing table is consulted before Android's default policy rules (priority 10000+). Fixes issue where ZeroTier shows connected but cannot ping other peers (100% packet loss) despite correct routing table configuration. Tested on: - Device: Infinix X6833B (Android 14, API 34) - Architecture: arm64-v8a - ZeroTier: 1.14.2 - Module: zerotier-magisk-aarch64-gcc-SSO-e2c0c3a - IP command: iproute2-ss171113
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix ZeroTier connectivity on Android 14+ devices by replacing unsupported 'pref' keyword with 'priority' in ip rule commands.
Problem
After installing zerotier-magisk on Android 14 (API 34), ZeroTier service was running and connected, but pinging other devices resulted in 100% packet loss. The routing table showed correct routes, but they weren't being used.
Root Cause
The Magisk module's
service.shscript attempted to add a high-priority routing rule:The
prefkeyword is not supported by Android'sipcommand (correct keyword ispriority), causing these commands to fail silently on every boot. Without this rule, Android's default policy routing rules (priority 10000+) took precedence.Solution
Changed
pref 1topriority 1inmagisk/lib.sh__start() function.Testing
Verified:
ip rule add from all lookup main priority 1works correctly