LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 769|回复: 3

Linux服务器遭遇DoS攻击

[复制链接]
发表于 2003-11-13 23:54:35 | 显示全部楼层 |阅读模式
只要一启动Apache就会发现有很多个连接来自同一个IP,然后Apache就不能对外服务了。

请高手帮忙解决,谢谢!
发表于 2003-11-14 01:36:20 | 显示全部楼层
试试调整一下tcp/ip参数, For Linux kernel 2.2,其它版本未经证实。
    /sbin/sysctl -w net.ipv4.tcp_max_syn_backlog=1280 或者更大
    Increases the size of the socket queue (effectively, q0).

    /sbin/sysctl -w net.ipv4.tcpsyn_cookies=1
    Enables support for TCP SYN cookies, which mitigates the effectiveness of SYN floods. However, this may cause performance problems for large windows (see RFC1323 and RFC2018). To read more about SYN cookies, please review DJ Bernstein's paper here.

    /sbin/sysctl -w net.ipv4.conf.all.send_redirects=0
    /sbin/sysctl -w net.ipv4.conf.all.accept_redirects=0

    /sbin/sysctl -w net.ipv4.conf.all.accept_source_route=0
    Drop all source route packets.

    /sbin/sysctl -w net.ipv4.conf.all.forwarding=0
    /sbin/sysctl -w net.ipv4.conf.all.mc_forwarding=0

    /sbin/sysctl -w net.ipv4.vs.timeout_timewait=60 缩短连接超时时间
    Sockets will linger in TIME_WAIT state for no more than 60 seconds.

    /sbin/sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1
    Do not respond to directed broadcasts.


原文
http://www.cymru.com/Documents/ip-stack-tuning.html
 楼主| 发表于 2003-11-14 09:07:56 | 显示全部楼层
这些我不会弄啊,他是指针对HTTP进行攻击,我可不可以配置Apache让每个IP只能有5个或者更少的链接啊
发表于 2003-11-14 11:51:47 | 显示全部楼层
最初由 juliaugong 发表
这些我不会弄啊,他是指针对HTTP进行攻击,我可不可以配置Apache让每个IP只能有5个或者更少的链接啊

一个普通的html页面,一般需要十几个或几十个并发联接,这是协议造成的。如果做如此限制则连一个完整的页面也无法显示,何况许多访问是通过nat形式进行。
如果是单点攻击,建议用路由或iptables规则过滤该地址做应急处理。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表