You are not logged in.

#1 2019-04-13 16:07:46

Liiht
Member
Registered: 2019-04-13
Posts: 21

How to disable IPV6

I've been trying to disable IPV6 as I think it is making my connection slow. I have looked at the arch wiki (https://wiki.archlinux.org/index.php/IPv6#Disable_IPv6) for how to do this and it recommends adding a few lines to /etc/sysctl.d/40-ipv6.conf. The problem that I have is that that file is missing and when I add I create it and the recommended lines, I still get an IPV6 address. I have added these lines to it:

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

The output from ifconfig looks like this:

enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.180  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::7e7f:c4a0:f2b1:b023  prefixlen 64  scopeid 0x20<link>
        inet6 2a00:23c4:891b:8201:b95d:ff9f:4df1:cdd6  prefixlen 64  scopeid 0x0<global>
        ether fc:aa:14:0d:9a:39  txqueuelen 1000  (Ethernet)
        RX packets 6697  bytes 3038492 (2.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6200  bytes 725617 (708.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I don't know really know where I'm going wrong, but if someone could explain that would be great. (Also I am using i3-gaps but I don't think that's relevant apart from the fact its sort of difficult to use the nm-applet)

Last edited by Liiht (2019-04-13 16:08:27)

Offline

#2 2019-04-13 16:13:13

loqs
Member
Registered: 2014-03-06
Posts: 17,884

Re: How to disable IPV6

Welcome to the arch linux forums Liiht.
What is the output of the following

systemctl status systemd-sysctl.service
sysctl net.ipv6.conf.all.disable_ipv6 net.ipv6.conf.lo.disable_ipv6 net.ipv6.conf.enp1s0f0.disable_ipv6
stat /etc/sysctl.d/40-ipv6.conf

Offline

#3 2019-04-13 16:19:20

Liiht
Member
Registered: 2019-04-13
Posts: 21

Re: How to disable IPV6

systemctl status systemd-sysctl.service outputs:   

Loaded: loaded (/usr/lib/systemd/system/systemd-sysctl.service; static; vendor preset: disabled)
   Active: active (exited) since Sat 2019-04-13 17:47:00 BST; 27min ago
     Docs: man:systemd-sysctl.service(8)
           man:sysctl.d(5)
  Process: 298 ExecStart=/usr/lib/systemd/systemd-sysctl (code=exited, status=0/SUCCESS)
Main PID: 298 (code=exited, status=0/SUCCESS)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

sysctl net.ipv6.conf.all.disable_ipv6 net.ipv6.conf.lo.disable_ipv6 net.ipv6.conf.enp1s0f0.disable_ipv6 outputs:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
sysctl: cannot stat /proc/sys/net/ipv6/conf/enp1s0f0/disable_ipv6: No such file or directory

and stat /etc/sysctl.d/40-ipv6.conf outputs:

File: /etc/sysctl.d/40-ipv6.conf
  Size: 108           Blocks: 8          IO Block: 4096   regular file
Device: 812h/2066d    Inode: 787742      Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-04-13 17:36:59.879646504 +0100
Modify: 2019-04-13 17:28:11.777092962 +0100
Change: 2019-04-13 17:28:11.777092962 +0100
Birth: 2019-04-13 17:28:11.777092962 +0100

Offline

#4 2019-04-13 16:20:23

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 631

Re: How to disable IPV6

@Liiht

Did you notice this part of the article you reference?

"Note that you must list all of the targeted interfaces explicitly, as disabling all.disable_ipv6 does not apply to interfaces that are already "up" when sysctl settings are applied. "

Edit: also, don't forget to check your hosts file to comment out ipv6 entries.

Last edited by Zod (2019-04-13 16:30:21)

Offline

#5 2019-04-13 16:21:57

loqs
Member
Registered: 2014-03-06
Posts: 17,884

Re: How to disable IPV6

I believe enp3s0 has an IPV6 address because it was up before net.ipv6.conf.all.disable_ipv6 was set and it is not matched by net.ipv6.conf.enp1s0f0.disable_ipv6

Offline

#6 2019-04-13 16:29:26

Liiht
Member
Registered: 2019-04-13
Posts: 21

Re: How to disable IPV6

Zod wrote:

Did you notice this part of the article you reference?

"Note that you must list all of the targeted interfaces explicitly, as disabling all.disable_ipv6 does not apply to interfaces that are already "up" when sysctl settings are applied. "

I did see that, I thought that i had done that but I made a mistake with net.ipv6.conf.enp1s0f0.disable_ipv6 as loqs pointed out, I changed that line to be

net.ipv6.conf.enp3s0.disable_ipv6 = 1

and rebooted but it still gets the IPV6 address.

Offline

#7 2019-04-13 16:41:49

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 631

Re: How to disable IPV6

https://wiki.archlinux.org/index.php/sysctl

particularly this

"To preserve changes between reboots, add or modify the appropriate lines in /etc/sysctl.d/99-sysctl.conf or another applicable parameter file in /etc/sysctl.d/. "

Offline

#8 2019-04-13 16:44:59

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,851
Website

Re: How to disable IPV6

I use this kernel boot parameter

ipv6.disable=1

https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

#9 2019-04-13 16:48:09

loqs
Member
Registered: 2014-03-06
Posts: 17,884

Re: How to disable IPV6

@Zod is /etc/sysctl.d/40-ipv6.conf as used by Liiht and referenced in the wiki not such a config file?
Does that file not work on your system?
If it was not being read were net.ipv6.conf.all.disable_ipv6 and net.ipv6.conf.lo.disable_ipv6 set to 1?
@Liiht what is the output now of

sysctl net.ipv6.conf.enp3s0.disable_ipv6

Edit:
@ugjka any ideas why disabling per interface is failing?

Last edited by loqs (2019-04-13 16:49:12)

Offline

#10 2019-04-13 16:53:33

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,851
Website

Re: How to disable IPV6

@loqs oh this is NM. I vaguely remember that NM reenables ipv6 on its own and you have to disable it through NM but i could be wrong on that


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

#11 2019-04-13 16:57:03

Liiht
Member
Registered: 2019-04-13
Posts: 21

Re: How to disable IPV6

@loqs The output of sysctl net.ipv6.conf.enp3s0.disable_ipv6:

net.ipv6.conf.enp3s0.disable_ipv6 = 0

Last edited by Liiht (2019-04-13 16:57:18)

Offline

#12 2019-04-13 16:57:21

loqs
Member
Registered: 2014-03-06
Posts: 17,884

Re: How to disable IPV6

Ah would make sense if something else adds IPV6 back.  I checked locally and after a reboot

net.ipv6.conf.all.disable_ipv6 = 1

was enough for all interfaces to lose IPV6 addresses but this system uses netctl.

Offline

#13 2019-04-13 17:03:05

Liiht
Member
Registered: 2019-04-13
Posts: 21

Re: How to disable IPV6

I managed to get it to not have an IPV6 address by adding

noipv6rs
noipv6

to /etc/dhcpcd.conf
also I commented out

#slaac private
#noipv4ll

because the comment above mentionded ipv6, although it doesn't seem to have do anything. Although I'm not sure this is the best solution.

Offline

#14 2019-04-13 17:05:35

Liiht
Member
Registered: 2019-04-13
Posts: 21

Re: How to disable IPV6

loqs wrote:

was enough for all interfaces to lose IPV6 addresses but this system uses netctl.

I have got netctl installed.

Offline

#15 2019-04-13 17:26:46

loqs
Member
Registered: 2014-03-06
Posts: 17,884

Re: How to disable IPV6

Liiht wrote:
loqs wrote:

was enough for all interfaces to lose IPV6 addresses but this system uses netctl.

I have got netctl installed.

I failed to notice in the ifconfig output you posted enp3s0 had two IPV6 addresses indicating your system's router supports IPV6 while this system's router does not so it only had the link local IPV6 address.

Offline

#16 2019-04-13 17:44:24

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 631

Re: How to disable IPV6

I added   

net.ipv6.conf.enp9s0.disable_ipv6 = 1

to /etc/sysctl.d/40-ipv6.conf

and rebooted

I use wicd (enabled) to control network connection with dhclient (not enabled)

Carlos% ip link show dev enp9s0
2: enp9s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether a4:ba:db:99:a0:5d brd ff:ff:ff:ff:ff:ff
Carlos% ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp9s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether a4:ba:db:99:a0:5d brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.75/24 brd 192.168.1.255 scope global enp9s0
       valid_lft forever preferred_lft forever
3: wlp12s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:24:d6:52:3f:f8 brd ff:ff:ff:ff:ff:ff

Last edited by Zod (2019-04-13 18:46:02)

Offline

#17 2019-04-13 18:09:36

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,851
Website

Re: How to disable IPV6

Liiht wrote:

I don't know really know where I'm going wrong, but if someone could explain that would be great. (Also I am using i3-gaps but I don't think that's relevant apart from the fact its sort of difficult to use the nm-applet)

Liiht wrote:

...
I have got netctl installed.

Erm, i'm confused here. You can't have both


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

Board footer

Powered by FluxBB