当我在CentOS 7中运行“sysctl -p”时,发生错误

当我在CentOS 7中运行sysctl -p时,出现错误:

 :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 

我究竟做错了什么?

要通过procfs启用net.ipv4.conf.all.rp_filter可以这样做。

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

然后运行sysctl -p请在sysctl: setting key "net.core.somaxconn": Invalid argument的第9行sysctl: setting key "net.core.somaxconn": Invalid argument