How to disable ipv6

Hi,

I’m trying to disable ipv6 (we have no use of it and we’re currently debugging network issues so we’d like to take ipv6 out of the possible source for issue).

I did the systcl.conf technique by adding this to the /etc/sysctl.conf :

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

But i’d like to disable the ipv6 stack completely, at the kernel level, i tried to find a way to update kernel cmdline parameters, ideally from user space, is there any way to achieve this ?

We’re using toradex SOM on colibri carrier board :

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.77-6.3.0+git.ddc6ca4d76ea #1-TorizonCore SMP PREEMPT Thu Jun 29 10:14:22 UTC 2023
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/1a85db306f124fca9d5f44d5dd75f78e21795bc203e60eb7a81886ba5e385ed6/0
Distro name:              NAME="TorizonCore"
Distro version:           VERSION_ID=6.3.0-build.4
Hostname:                 demo
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Colibri iMX8QXP on Colibri Evaluation Board V3
Toradex version:          0038 V1.0D
Serial number:            07330227
Processor arch:           aarch64
------------------------------------------------------------

Thanks for your support

Greetings @pierreB,

You can customize the kernel command line arguments with TorizonCore Builder as documented here: Customizing Kernel Arguments in Torizon | Toradex Developer Center

Or, in U-Boot you can set the tdxargs environment variable. This variable gets appended on to the list of kernel command line arguments during boot.

Best Regards,
Jeremias

Hi @jeremias.tx ,
Thanks for your answer, from my understanding the solution based on torizonCore Builder is only in a “custom” kernel building, am I wrong ?

Regarding the U-Boot solution, which seems to answer my request of updating the kernel cmdline without the need of building a custom kernel, do you have any guide to ease the implementation of this solution ?

Regards,

Thanks for your answer, from my understanding the solution based on torizonCore Builder is only in a “custom” kernel building, am I wrong ?

TorizonCore Builder does not in any case re-build the linux kernel itself. It only makes small modifications. In this case all it would be doing is appending kernel arguments to the existing kernel command line. This does not require building a custom kernel.

Regarding the U-Boot solution, which seems to answer my request of updating the kernel cmdline without the need of building a custom kernel, do you have any guide to ease the implementation of this solution ?

It’s fairly self explanatory, you just need to set a value of tdxargs in U-Boot. Whatever is in tdxargs gets appended to the kernel command line. If tdxargs is equal to foo then foo will be appended onto the kernel command line. If you don’t know how to modify environment variables in U-Boot then look here: U-Boot | Toradex Developer Center

Best Regards,
Jeremias

Ok, thanks for the informations, i’ll handle from there then.

Regards,

1 Like

Glad I was able to help!