linux网络优化

yegen00 2012-10-04

禁止发送重定向

net.ipv4.conf.eth1.send_redirects=0

net.ipv4.conf.eth0.send_redirects=0

net.ipv4.conf.default.send_redirects=0

net.ipv4.conf.all.send_redirects=0

不接受icmp重定向

net.ipv4.conf.eth1.accept_redirects=0

net.ipv4.conf.eth0.accept_redirects=0

net.ipv4.conf.lo.accept_redirects=0

net.ipv4.conf.default.accept_redirects=0

net.ipv4.conf.all.accept_redirects=0

忽略所有类型的icmp或ping

net.ipv4.icmp_echo_ignore_all=1

新连接time-wait状态的socket重利用

net.ipv4.tcp_tw_reuse=1

net.ipv4.tcp_tw_recycle=1

未用tcp并发连接超时时间30分钟

net.ipv4.tcp_keepalive_time=1800

半连接限制,防Dos攻击

net.ipv4.tcp_max_syn_backlog=4096

tcp-sack和tcp-dsack优化

net.ipv4.tcp_sack=0

net.ipv4.tcp_dsack=0

不接收tcp-timestamp

net.ipv4.tcp_timestamps=0

禁用tcp窗口扩展

net.ipv4.tcp_window_scaling=0

相关推荐