我有两个VMs;一个带有RHEL7NAD,另一个使用CentOS 7。在两个VMS上运行sysctl net.ipv6.conf.all.accept_ra
会显示不同的行为。
CentOS 7
$ sysctl net.ipv6.conf.all.accept_ra
net.ipv6.conf.all.accept_ra = 1
RHEL7
# sysctl net.ipv6.conf.all.accept_ra
sysctl: cannot stat /proc/sys/net/ipv6/conf/all/accept_ra: No such file or directory
然而,这个参数net.ipv6.conf.all.accept_ra
存在于/etc/sysctl.conf
文件中。
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
fs.suid_dumpable = 0
kernel.randomize_va_space = 2
net.ipv4.ip_forward = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.default.log_martians = 1
pv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.tcp_syncookies = 1
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.default.accept_ra = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0
net.core.somaxconn=511
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.default.accept_ra = 0
RHEL 7错误的原因是什么?
后来,我发现ipv6
目录在/proc/sys/net/
中没有。原因是什么?
发布于 2020-04-15 13:19:13
IPv6在您的系统启动时已被禁用。这样做后,根本就没有IPv6的痕迹了。
这通常是通过在/etc/default/grub
中添加一个选项来完成的。
如果是这样的话,您可以通过编辑/etc/default/grub
并删除选项ipv6.disable=1
来恢复此设置,该选项应该出现在以GRUB_CMDLINE_LINUX
开头的行中,然后运行:
grub2-mkconfig -o /boot/grub2/grub.cfg
若要使用更改重新生成GRUB选项,请执行以下操作。
然后需要重新启动。
https://unix.stackexchange.com/questions/580170
复制相似问题