Chinaunix首页 | 论坛 | 博客
  • 博客访问: 728041
  • 博文数量: 235
  • 博客积分: 4309
  • 博客等级: 中校
  • 技术积分: 2325
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-17 11:25
个人简介

If you don\\\\\\\\\\\\\\\'t wanna do it, you find an EXCUSE; if you do, you\\\\\\\\\\\\\\\'ll find a WAY :-)

文章分类

全部博文(235)

文章存档

2014年(3)

2013年(2)

2012年(31)

2011年(199)

分类: LINUX

2011-01-18 16:00:00

By tunning kernel parameters can improve linux socket io performance. The settings for sysctl.conf below apply for Fedora, RedHat, Centos OS as well as other Linux flavors. These settings will improve your server network performance and some little protection against ddos attacks as well. 

# Kernel sysctl configuration file for Red Hat Linux 

# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and 
# sysctl.conf(5) for more details.

# Disables packet forwarding 
net.ipv4.ip_forward=0

# Disables IP source routing 
net.ipv4.conf.all.accept_source_route = 0 
net.ipv4.conf.lo.accept_source_route = 0 
net.ipv4.conf.eth0.accept_source_route = 0 
net.ipv4.conf.default.accept_source_route = 0

# Enable IP spoofing protection, turn on source route verification 
net.ipv4.conf.all.rp_filter = 1 
net.ipv4.conf.lo.rp_filter = 1 
net.ipv4.conf.eth0.rp_filter = 1 
net.ipv4.conf.default.rp_filter = 1

# Disable ICMP Redirect Acceptance 
net.ipv4.conf.all.accept_redirects = 0 
net.ipv4.conf.lo.accept_redirects = 0 
net.ipv4.conf.eth0.accept_redirects = 0 
net.ipv4.conf.default.accept_redirects = 0

# Enable Log Spoofed Packets, Source Routed Packets, Redirect Packets 
net.ipv4.conf.all.log_martians = 0 
net.ipv4.conf.lo.log_martians = 0 
net.ipv4.conf.eth0.log_martians = 0

# Disables IP source routing 
net.ipv4.conf.all.accept_source_route = 0 
net.ipv4.conf.lo.accept_source_route = 0 
net.ipv4.conf.eth0.accept_source_route = 0 
net.ipv4.conf.default.accept_source_route = 0

# Enable IP spoofing protection, turn on source route verification 
net.ipv4.conf.all.rp_filter = 1 
net.ipv4.conf.lo.rp_filter = 1 
net.ipv4.conf.eth0.rp_filter = 1 
net.ipv4.conf.default.rp_filter = 1

# Disable ICMP Redirect Acceptance 
net.ipv4.conf.all.accept_redirects = 0 
net.ipv4.conf.lo.accept_redirects = 0 
net.ipv4.conf.eth0.accept_redirects = 0 
net.ipv4.conf.default.accept_redirects = 0

# Disables the magic-sysrq key 
kernel.sysrq = 0

# Decrease the time default value for tcp_fin_timeout connection 
net.ipv4.tcp_fin_timeout = 15

# Decrease the time default value for tcp_keepalive_time connection 
net.ipv4.tcp_keepalive_time = 400

# Turn off the tcp_window_scaling 
net.ipv4.tcp_window_scaling = 0

# Turn off the tcp_sack 
net.ipv4.tcp_sack = 0

# Turn off the tcp_timestamps 
net.ipv4.tcp_timestamps = 0

# Enable TCP SYN Cookie Protection 
net.ipv4.tcp_syncookies = 1

# Lower syn retry rates 
net.ipv4.tcp_synack_retries = 2 
net.ipv4.tcp_syn_retries = 3

# Enable ignoring broadcasts request 
net.ipv4.icmp_echo_ignore_broadcasts = 1

# Enable bad error message Protection 
net.ipv4.icmp_ignore_bogus_error_responses = 1

# Log Spoofed Packets, Source Routed Packets, Redirect Packets 
net.ipv4.conf.all.log_martians = 1

# Increases the size of the socket queue (effectively, q0). 
net.ipv4.tcp_max_syn_backlog = 1024

# Increase the tcp-time-wait buckets pool size 
net.ipv4.tcp_max_tw_buckets = 1440000

# Allowed local port range 
net.ipv4.ip_local_port_range = 16384 65536
阅读(469) | 评论(0) | 转发(0) |
0

上一篇:No Market _No Gmail

下一篇:Kali

给主人留下些什么吧!~~