SYN attack defense in Linux

Source: Internet
Author: User
If you suspect a Dos attack in Linux, you can enter netstat-angrep-I "server IP address: 80 "awk'' {print} 'sortuniq-csort-nnetstat-angrepSYNwc-l this command will automatically count the number of Tcp connections in various states, if SYN_RECV is very high

If you suspect a Dos attack in Linux, you can enter

Netstat-an grep-I "server IP Address: 80" awk ''{print} 'sort uniq-c sort-n

Netstat-an grep "SYN" wc-l

This command will automatically count the number of Tcp connections in various states. if SYN_RECV is high, the possibility of tcp-based ddos attacks cannot be ruled out. in this case, you can enable tcp_syncookies and enter the following command


Echo 1>/proc/sys/net/ipv4/tcp_syncookies

If no/proc/sys/net/ipv4/tcp_syncookies are available, your kernel is not supported and you need to recompile the kernel.

At the same time, the number of syn retries is reduced.

Echo 1>/proc/sys/net/ipv4/tcp_syn_retries

Echo 1>/proc/sys/net/ipv4/tcp_synack_retries

Increase syn_backlog to ensure user access (memory consumption, too high ..)

Echo "2048">/proc/sys/net/ipv4/tcp_max_syn_backlog

If it still does not work, it can only be handed over to the corresponding hardware firewall.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.