在 Linux CentOS7 上,sysctl 无法在逻辑/vlan/子接口上禁用 IPv6:
$ 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
$
我怎么做 ?