Jump to content

How to disable ipv6


Zarif2000
Go to solution Solved by MichaIng,

Recommended Posts

Hello.
I faced with a problem, I can't disable ipv6 completely on Armbian 23.05.1. Orange Pi PC.
Tried to use armbian-config to disable ipv6 in Network menu, but no luck, apps can use it at the moment

netstat -tulpn | grep :::    gives me

udp6       0      0 :::53                   :::*                                1134/pihole-FTL
udp6       0      0 :::111                  :::*                                1/init


Thanks in advance.

Link to comment
Share on other sites

8 часов назад, TRS-80 сказал:

I disable it at my router (which is running OpenWrt).

My ISP doesn't provide ipv6. And also I user ip6tables and configured default policies on Armbian:

ip6tables -P INPUT DROP
ip6tables -P OUTPUT DROP
ip6tables -P FORWARD DROP


But I can't find out how to disable it completely.

I tried to add these lines to sysctl
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

not working!

Next idea is to disable ipv6 via grub. But there is no /etc/default/grub file on Armbian.

Edited by Zarif2000
Link to comment
Share on other sites

  • Solution
sudo sed -i '/^extraargs=/$/ ipv6.disable=1/' /boot/armbianEnv.txt

 

Respectively add ipv6.disable=1 to the end of the "extraargs" line, separated with a space from other possible values.


However, this disables IPv6 support completely kernel-wise, which some software has problems with. E.g. the default Apache2 config on Debian comes with a vhost which dynamically binds to IPv4 and/or IPv6 addresses based on whether it is active on the interface or not. This syntax requires the kernel to at least understand IPv6, otherwise the webserver fails to start. So it is generally safer to only disable IPv6 on all interfaces, but keeping the kernel module active:

 

echo -e 'net.ipv6.conf.all.disable_ipv6=1\nnet.ipv6.conf.default.disable_ipv6=1' | tee /etc/sysctl.d/disable_ipv6.conf
sudo sysctl -p /etc/sysctl.d/disable_ipv6.conf

 

EDIT: Ah, now I see you basically tried this already. As this is universally functional on all Linux distros, it must actually work. Not sure how exactly to tried it, which exact command or config file? E.g. using the sysctl command itself is not boot-persistent, hence the config file.

Edited by MichaIng
Link to comment
Share on other sites

31.08.2023 в 09:33, Zarif2000 сказал:

I tried to add these lines to sysctl

As I was telling earlier, I used sysctl file.

 

12.09.2023 в 19:37, MichaIng сказал:

E.g. the default Apache2 config on Debian comes with a vhost which dynamically binds to IPv4 and/or IPv6 addresses based on whether it is active on the interface or not.

Sounds logical. And as far as I don't want to face with strange errors in a future, I'll let ipv6 in normal state.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines