web-dev-qa-db-ja.com

CentOS7で「sysctl-p」を実行するとエラーが発生します

実行するとsysctl -p CentOS 7では、次のエラーが発生します。

:sysctl: cannot stat /proc/sys/net/ipv4/conf/eth0/rp_filter: No such file or directory

僕の /etc/sysctl.confは:

vm.overcommit_memory = 1
net.ipv4.tcp_max_syn_backlog = 20480
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.core.rmem_max = 16777216
net.core.rmem_default = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
sysctl: setting key "net.core.somaxconn": Invalid argument
net.core.somaxconn = 262144
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.lo.rp_filter = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_tw_buckets = 1200000
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_rmem = 4096 87380 8388608
net.ipv4.tcp_wmem = 4096 65536 8388608
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
kernel.panic = 5
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.lo.rp_filter = 0

私は何が間違っているのですか?

1
MeRyan

Procfsを介してnet.ipv4.conf.all.rp_filterを有効にするには、これを行います。

echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter

次に、sysctl -pを実行します。設定の9行目でこれを削除してくださいsysctl: setting key "net.core.somaxconn": Invalid argument

2
Joenel de Asis