Kernel: ip_conntrack: Table full, dropping packet.

Source: Internet
Author: User

There is a problem with a download server today, and packet loss is very serious. After restarting, check the system logs. Many "kernel: ip_conntrack: Table full, dropping packet ."

Search online and solve it with hping

Download hping:
Http://www.hping.org/download.html

./Configure
Make
Make install

After installation, write a script:

Code:

#! /Bin/bash

Echo
Echo "############################"
Echo "# edit by youngh 2003.06.24 V1.1"
Echo "# usage: clr_conns IPaddress"
Echo "# This will clear all connections from this ip_address"
Echo "# example:/root/clr_conns 10.0.3.3"
Echo "############################"
Echo

If [-Z $1]; then
Exit
Fi

Grep-e "^ TCP. {10, 25} established src = $1"/proc/NET/ip_conntrack | while read line; do
S_ip = 'echo $ Line | awk' {print substr ($5, 5 )}''
S_sock = 'echo $ Line | awk '{print substr ($7, 7 )}''
D_ip = 'echo $ Line | awk' {print substr ($6, 5 )}''
D_sock = 'echo $ Line | awk '{print substr ($8, 7 )}''
Echo "$ s_ip: $ s_sock $ d_ip: $ d_sock"

Hping2 $ d_ip-r-s $ s_sock-p $ d_sock-A $ s_ip-K-C 1>/dev/null 2>/dev/null &

Done

Save as clr_conns.sh

Usage:

Sh clr_conns.sh x. x

The displayed connection can be cleared.

From: China Linux Forum

 

View the first IP addresses of ip_conntrack

CAT/proc/NET/ip_conntrack | cut-D ''-f 10 | cut-d' = '-F 2 | sort | uniq-c | sort-Nr | head-n 5

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.