The officially official Devuan Forum!

You are not logged in.

#1 2023-10-15 18:44:55

Danielsan
Member
Registered: 2020-07-14
Posts: 178  

How to disable IPv6?

Hi guys,

I have some issues with dropbear and I believe is because ipv6 and therefore I want to disable it.
I didn't find specific documentation on the Debian wiki but this arguable tutorial I found didn't work either:

# Disabling the IPv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

updated initramfs and rebooted, but still ipv6.

Any suggestions?

Thanks! 🙏

Last edited by Danielsan (2023-10-15 18:45:52)

Offline

#2 2023-10-15 20:09:50

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 648  

Re: How to disable IPv6?

Hi, I add a  ipv6.disable=1 line to grub... the vpn I have only uses ipv4

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# GlennsPref 20230920 ipv6

GRUB_DEFAULT=0
GRUB_TIMEOUT=4
GRUB_DISTRIBUTOR=`lsb_release -i -s`
GRUB_CMDLINE_LINUX_DEFAULT="console=tty12 vga=794 modeset.nouveau=0 nokmsboot ipv6.disable=1"

# discover other os's
GRUB_DISABLE_OS_PROBER=false

GRUB_GFXMODE=1920x1080

GRUB_INIT_TUNE="400 440 1"
# resume=uuid errors... noresume "we don't susspend"
GRUB_CMDLINE_LINUX="noresume idle=nomwait"

GRUB_THEME=/usr/share/desktop-base/grub-themes/desktop-grub-theme/theme.txt

run update-grub as root, and reboot.

all the best


pic from 1993, new guitar day.

Offline

#3 2023-10-17 06:01:42

Danielsan
Member
Registered: 2020-07-14
Posts: 178  

Re: How to disable IPv6?

@GlennW that worked, thanks!

Although it says: "ipv6 loaded but administratively disabled" ; it would be cool understand how to prevent ipv6 to be loaded.
Anyway it was enough to let dropbear able to listen in fact I was able to drop the bear into the other pc! 😁

Offline

#4 2023-10-17 14:39:20

steve_v
Member
Registered: 2018-01-11
Posts: 387  

Re: How to disable IPv6?

Danielsan wrote:

it would be cool understand how to prevent ipv6 to be loaded.

If you don't want ipv6 support, recompile your kernel without ipv6 support, obviously.
Otherwise, disable it as already explained.


Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Offline

#5 2024-11-26 17:12:54

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 127  

Re: How to disable IPv6?

Hi,

I have a devuan-daedalus-6.1.93 running on a Raspberry.

I would like also to disable the ipv6 (system wide)

I've seen many time this:

nano /etc/sysctl.d/disableipv6.conf
#add line:
net.ipv6.conf.all.disable_ipv6=1

But If I don't mistaken this is only for systemd 🤢 ?

In the OP link, is the method 2 nano /etc/modprobe.d/blacklist-ipv6.conf ...

will work on sysv init ?

Thanks.


Linux noob, plz be kind big_smile

Offline

#6 2024-11-26 21:32:07

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 213  

Re: How to disable IPv6?

This is what I use to enable ipv6 in /etc/sysctl.conf .  This enables both ipv6 and ipv4

net.ipv6.bindv6only= 0

This would disable ipv6:

net.ipv6.bindv6only=1

Also,
I did a quick web search and this was a top reply.  I forgot to save the link, sorry.

How to disable IPv6 with Sysctl?
Open the  /etc/sysctl.conf  file with the following command:
$ sudo nano /etc/sysctl.conf

Add the following lines to it:

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

Reload. sysctl.conf. with the following command:
sysctl -p

I think that one, or both, of these methods should work.

Offline

#7 2024-11-27 06:49:08

stargate-sg1-cheyenne-mtn
Member
Registered: 2023-11-27
Posts: 208  

Re: How to disable IPv6?

try adding

ipv6.disable=1

to the commandline bootcode.

also i seem to recall needing to comment out all the ipv6 stuff in the /etc/hosts file

# commented out all the ipv6 stuff to quiet the /var/log/exim4 report logs
#::1		 localhost
#::1             ip6-localhost ip6-loopback
#fe00::0         ip6-localnet
#fe00::0         ip6-mcastprefix
#ff00::0	 ip6-mcastprefix
#fe02::1         ip6-allnodes
#fe02::1         ip6-allrouters
#ff02::1	 ip6-allnodes
#ff02::2	 ip6-allrouters
#ff02::3	 ip6-allhosts
#fe80::1%lo0	 localhost

you might even check what NetworkManager reports

sudo NetworkManager --print-config

keep us posted on your progress.


Be Excellent to each other and Party On!
https://www.youtube.com/watch?v=rph_1DODXDU
https://en.wikipedia.org/wiki/Bill_%26_Ted%27s_Excellent_Adventure
Do unto others as you would have them do instantaneously back to you!

Online

#8 2024-11-27 15:26:43

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 127  

Re: How to disable IPv6?

Thanks nixer & SSCM

I created a init script /init.d/....

with

sysctl -w net.ipv6.conf.default.disable_ipv6=1
sysctl -w net.ipv6.conf.all.disable_ipv6=1

inside.

now just remain to test if IPv6 is really disabled ! (any ideas ?)

Last edited by SpongeBOB (2024-11-27 15:27:20)


Linux noob, plz be kind big_smile

Offline

#9 2024-11-27 18:25:51

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 213  

Re: How to disable IPv6?

I created a init script /init.d/....

with

    sysctl -w net.ipv6.conf.default.disable_ipv6=1
    sysctl -w net.ipv6.conf.all.disable_ipv6=1

I don't think that would do much, but I would simply add the two lines to the  /etc/sysctl.conf  file and then test it out.  Be sure to run "sysctl -p" after saving the file.

If you wanted to run the lines of code at boot, you might want to try adding them to the  /etc/rc.local  file, but I think the /etc/sysctl.conf file would be better.

Offline

#10 2024-12-02 07:19:23

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 127  

Re: How to disable IPv6?

Thank you nixer !

indeed /etc/sysctl.conf is easy and make the most sense (tested and worked btw smile )

Last edited by SpongeBOB (2024-12-02 07:56:11)


Linux noob, plz be kind big_smile

Offline

Board footer