Following this thread:
I discovered that echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 indeed works on my Samsung Galaxy S23 (One UI 7.0). However, a reboot undoes this, because it reloads system configs from a prepackaged image.
One could decompress the image, make the relevant tweaks, recompress the image and have Bob be your uncle that way, according to a quick search on the World Wide Web. However, for those of you that use Magisk - and maybe are rooted through Magisk, I am unsure (my S23 is rooted with Magisk) -, there are some directories that I suppose Magisk sets up to be used for custom boot up scripts:
https://github.com/topjohnwu/Magisk/blob/master/docs/guides.md#boot-scripts
Taking inspiration from these two guides:
https://xdaforums.com/t/guide-how-to-run-a-script-at-every-boot-using-magisk.4454493/ https://xdaforums.com/t/guide-how-to-change-any-file-or-directory-using-magisk.4543103/
I decided to put my script for disabling ipv6 into /data/adb/service.d
While this did disable ipv6 for some of the interfaces among the - pardon my French - messed up array that is the Android network stack (since I don’t understand it, that is…), some interfaces either remain ipv6-enabled or get reconfigured during or after boot. Thus, I tried giving the script some waiting time, which worked. Now, after each boot, all of my relevant interfaces are ipv6-disabled:
#!/system/bin/sh
sleep 60 ; echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
This did not prolong the boot process 60 seconds.
Edit: while the configuration does “survive”, or rather, come into effect at boot, it resets at WiFi disconnect. Maybe it has to do with MAC address randomization being turned on. I’m not putting more time and effort into this.
Edit2: I guess the takeaway is, that you could run a great variety of scripts this way.


Welcome to the Android community on Lemmy. Here you can participate in amazing discussions and events relating to all things Android.
The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:
1. All posts must be relevant to Android devices/operating system.
2. Posts cannot be illegal or NSFW material.
3. No spam, self promotion, or upvote farming. Sources engaging in these behavior will be added to the Blacklist.
4. Non-whitelisted bots will be banned.
5. Engage respectfully: Harassment, flamebaiting, bad faith engagement, or agenda posting will result in your posts being removed. Excessive violations will result in temporary or permanent ban, depending on severity.
6. Memes are not allowed to be posts, but are allowed in the comments.
7. Posts from clickbait sources are heavily discouraged. Please de-clickbait titles if it needs to be submitted.
8. Submission statements of any length composed of your own thoughts inside the post text field are mandatory for any microblog posts, and are optional but recommended for article/image/video posts.
Community Resources:
I can think of no legitimate reason. I just do it because I know how to work with ipv4. I’m just about to start learning ipv6, but since networking is but a hobby and I work long hours, the time and energy at my disposal is limited. As soon as I grasp ipv6, I guess I’ll re-enable it. Until then, I’ll just practice it in a container on my PC
From an end user perspective, there’s nothing to learn.
And that’s how we got to the moon.
But in all seriousness, I just love tech and I want to understand as much of it as I can before I die. :)
Most big sites support IPv6 today. It does perform better because optimised headers and less need for address translation on the way. Latest numbers show consumer support creeping up towards 50% already.
It used to be popular to disable it 20 years ago when a lot of networks had misconfigured 6rd.
I think it would have taken less time to learn than learning how to disable it. But meh