Icmp,tcp,traceroute,ping,iptables

Source: Internet
Author: User

There is a monitoring host in Dongguan to Beijing, the problem of BGP; alarm SMS sent frantically; find Dongguan IDC and Beijing BGP service Provider assistant investigation;

There is a strange problem; Beijing to Dongguan Trcaceroute have routing information

Dongguan 143 to Beijing there is no routing information; but, Dongguan 151 to Beijing there is routing information;

Check the iptables configuration for 143 and 151 segments, and find subtle differences:

143:

# Generated by Iptables-save v1.3.5 on Fri Dec 19 17:00:58 2014
*filter
: INPUT ACCEPT [0:0]
: FORWARD ACCEPT [0:0]
: OUTPUT ACCEPT [3,815,024,465:25,962,152,950,339]

......

-A input-m conntrack--ctstate established-j ACCEPT
-A input-i lo-j ACCEPT
-A input-j DROP
-A output-m conntrack--ctstate new-j ACCEPT
COMMIT
# completed on Fri Dec 19 17:00:58 2014

151:

# Generated by Iptables-save v1.4.7 on Fri Dec 19 17:01:18 2014
*filter
: INPUT ACCEPT [158,253,008:8,885,848,717]
: FORWARD ACCEPT [0:0]
: OUTPUT ACCEPT [108,990,300,717:428,153,347,609,533]

.................

-A input-m conntrack--ctstate established-j ACCEPT
-A input-i lo-j ACCEPT
-A input-p tcp-m tcp--dport 22-j DROP
-A output-m conntrack--ctstate new-j ACCEPT
COMMIT
# completed on Fri Dec 19 17:01:18 2014

It has been noted that:

-A input-j DROP--------------------------------------->ping is output;traceroute when each routing node returns the packet;

The rule-a output-m conntrack--ctstate new-j Accept is the TCP protocol by default, whereas the Ping/traceroute uses the ICMP protocol;

-A input-p tcp-m tcp--dport 22-j drop-----------------> This just DROP the 22 port, in addition to the others are released;

====

Optimize 143 segment configurations such as:

#-a input-p icmp-j ACCEPT------------------------------------------> Add this Rule
-A input-m conntrack--ctstate established-j ACCEPT
-A input-i lo-j ACCEPT
-A input-j DROP
#-a input-p tcp-m TCP--dport 22-j DROP
-A output-m conntrack--ctstate new-j ACCEPT
COMMIT
# completed on Fri Dec 19 17:05:26 2014

Icmp,tcp,traceroute,ping,iptables

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.