The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to set up servers to filter and deny ICMP ECHO (ping) packets?

Discussion in 'General Discussion' started by pingo, Aug 28, 2003.

  1. pingo

    pingo Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    430
    Likes Received:
    0
    Trophy Points:
    16
    How to set up servers to filter and deny ping packets?

    I would like to set it up deny on the servers main IP and filtering on all IPs on a server to avoid low level denial of service attacks happening due to icmp echo-reply abuse.

    I know that it won't be possible to do traceroutes and pings on the IP but I prefer the increased protection as I have experienced quite some attacks on servers IP lately.

    Does anybody here know how this can be done? Any help is gratefully received.

    Thanks
    John

    cPanel.net Support Ticket Number:
     
    #1 pingo, Aug 28, 2003
    Last edited: Aug 28, 2003
  2. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    Code:
    /bin/echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
    /bin/echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all
    /bin/echo "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
    
    iptables -A INPUT -p icmp -s 0/0 --icmp-type echo-request -j DROP
    iptables -A INPUT -p udp --dport 33434:33524 -j DROP
    cPanel.net Support Ticket Number:
     
  3. nyjimbo

    nyjimbo Well-Known Member

    Joined:
    Jan 25, 2003
    Messages:
    1,125
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    New York
    If you are running Freebsd you can do the blackhole thing. We were getting hammered with closed port icmp traffic at 200+ hits per second. Do:

    sysctl -w inet.net.udp.blackhole=1
    sysctl -w inet.net.tcp.blackhole=2

    this really f-cks up alot of port scanners and other icmp hacker/DDOS tools.

    Be careful though as some programs might not like the TCP blackhole, but experiment with them, it cant kill your system.

    :)

    cPanel.net Support Ticket Number:
     
  4. pingo

    pingo Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    430
    Likes Received:
    0
    Trophy Points:
    16
    Thanks for helping.

    John

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page