1

On Linux CentOS7, sysctl fails disabling IPv6 on a logical/vlan/sub interface :

$ ip -6 -o a show dev bond0.53
20: bond0.53    inet6 fe80::b283:feff:fee6:ba1/64 scope link \       valid_lft forever preferred_lft forever
$ sudo sysctl -w net.ipv6.conf.bond0.53.disable_ipv6=1
sysctl: cannot stat /proc/sys/net/ipv6/conf/bond0/53/disable_ipv6: No such file or directory
$ echo $?
255
$ ip -6 -o a show dev bond0.53
20: bond0.53    inet6 fe80::b283:feff:fee6:ba1/64 scope link \       valid_lft forever preferred_lft forever
$ echo net.ipv6.conf.bond0.53.disable_ipv6=1 | sudo tee -a /etc/sysctl.conf
net.ipv6.conf.bond0.53.disable_ipv6=1
$ sudo ifdown bond0.53
$ sudo ifup bond0.53
$ ip -6 -o a show dev bond0.53
21: bond0.53    inet6 fe80::b283:feff:fee6:ba1/64 scope link \       valid_lft forever preferred_lft forever
$ cat /etc/sysconfig/network-scripts/ifcfg-bond0.53
BOOTPROTO=none
DEFROUTE=no
DEVICE=bond0.53
IPADDR=172.16.53.140
GATEWAY=172.16.53.1
MTU=1500
NAME=bond0.VLAN_53
NM_CONTROLLED=no
ONBOOT=yes
PREFIX=24
TYPE=Ethernet
USERCTL=no
VLAN=yes
$

How do I do that ?

SebMa
  • 1,573
  • 2
  • 19
  • 25
  • 1
    I don't know, but doesn't `sysctl -a | grep disable_ipv6` return anything useful? I assume it does not work at the subint level. – Bib Jan 27 '23 at 22:00
  • @Bib Indeed, it does return something useful such as this : `sysctl: net.ipv6.conf.bond0/53.disable_ipv6 = 0`, therefore typing `sysctl -w net.ipv6.conf.bond0/53.disable_ipv6=1` solved my problem, thanks a lot. – SebMa Jan 30 '23 at 09:40

0 Answers0