「sysctl net.ipv6.conf.all.accept_ra」は CentOS 7 と RHEL 7 で動作が異なります

「sysctl net.ipv6.conf.all.accept_ra」は CentOS 7 と RHEL 7 で動作が異なります

2 つの VM があります。1 つは RHEL 7、もう 1 つは CentOS 7 です。実行すると、sysctl net.ipv6.conf.all.accept_ra2 つの VM で異なる動作が示されます。

セントOS7

$ 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/。その理由は何でしょうか?

答え1

IPv6が無効になっています起動時システム上でこのようにすると、利用可能な IPv6 の痕跡はまったく残りません。

通常、これは にオプションを追加することによって行われます/etc/default/grub

その場合は、次の行で始まる/etc/default/grubオプションを編集して削除し、次のコマンドを実行することで、この設定を元に戻すことができます。ipv6.disable=1GRUB_CMDLINE_LINUX

grub2-mkconfig -o /boot/grub2/grub.cfg

変更を加えた GRUB オプションを再生成します。

その後再起動が必要になります。

関連情報