How to Disable Ping ( TCP ) in Linux all the time? [closed]












0














I want to disable ping response all the time.
I use the following command for disable ICMP ping



iptables -A INPUT -p icmp --icmp-type echo-request -j DROP


what should I do for disable TCP ping ?










share|improve this question













closed as off-topic by Christopher, Rui F Ribeiro, RalfFriedl, Anthony Geoghegan, GAD3R Dec 17 at 20:23


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Christopher, Rui F Ribeiro, RalfFriedl

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 4




    There is no "TCP ping" in the way that you seem to think it does exist. ICMP works at Layer 3 (no ports), whereas "TCP ping" connects to any open TCP port, like 80. It's a bit of a misnomer.
    – Christopher
    Dec 17 at 17:20






  • 1




    As @Christopher says, TCP "ping" is just a fancy name for a program that (ab)uses the TCP protocol to confirm if a port listening in that TCP service number is open. So, if you want to provide that service.... The TCP ping "service" per se does not exist. As for disabling ICMP pings in iptables, it is a waste of resources, you have a sysctl kernel setting just for that.
    – Rui F Ribeiro
    Dec 17 at 17:22












  • I want to make sure someone cant check whether the tcp port is open or not
    – Víctor Marcianes
    Dec 17 at 17:38






  • 3




    Are you able to edit the question and explain better what are you after?
    – Rui F Ribeiro
    Dec 17 at 17:51










  • I want to make sure someone cant check whether the tcp port is open or not Why? What's the point of having an open port then? Anyone can test if the port is open simply by trying to connect to it. Anyone you want to give the ability to connect to can easily tell if the port is open.
    – Andrew Henle
    Dec 18 at 0:20
















0














I want to disable ping response all the time.
I use the following command for disable ICMP ping



iptables -A INPUT -p icmp --icmp-type echo-request -j DROP


what should I do for disable TCP ping ?










share|improve this question













closed as off-topic by Christopher, Rui F Ribeiro, RalfFriedl, Anthony Geoghegan, GAD3R Dec 17 at 20:23


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Christopher, Rui F Ribeiro, RalfFriedl

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 4




    There is no "TCP ping" in the way that you seem to think it does exist. ICMP works at Layer 3 (no ports), whereas "TCP ping" connects to any open TCP port, like 80. It's a bit of a misnomer.
    – Christopher
    Dec 17 at 17:20






  • 1




    As @Christopher says, TCP "ping" is just a fancy name for a program that (ab)uses the TCP protocol to confirm if a port listening in that TCP service number is open. So, if you want to provide that service.... The TCP ping "service" per se does not exist. As for disabling ICMP pings in iptables, it is a waste of resources, you have a sysctl kernel setting just for that.
    – Rui F Ribeiro
    Dec 17 at 17:22












  • I want to make sure someone cant check whether the tcp port is open or not
    – Víctor Marcianes
    Dec 17 at 17:38






  • 3




    Are you able to edit the question and explain better what are you after?
    – Rui F Ribeiro
    Dec 17 at 17:51










  • I want to make sure someone cant check whether the tcp port is open or not Why? What's the point of having an open port then? Anyone can test if the port is open simply by trying to connect to it. Anyone you want to give the ability to connect to can easily tell if the port is open.
    – Andrew Henle
    Dec 18 at 0:20














0












0








0







I want to disable ping response all the time.
I use the following command for disable ICMP ping



iptables -A INPUT -p icmp --icmp-type echo-request -j DROP


what should I do for disable TCP ping ?










share|improve this question













I want to disable ping response all the time.
I use the following command for disable ICMP ping



iptables -A INPUT -p icmp --icmp-type echo-request -j DROP


what should I do for disable TCP ping ?







linux tcp ping icmp






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 17 at 17:14









Víctor Marcianes

16




16




closed as off-topic by Christopher, Rui F Ribeiro, RalfFriedl, Anthony Geoghegan, GAD3R Dec 17 at 20:23


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Christopher, Rui F Ribeiro, RalfFriedl

If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by Christopher, Rui F Ribeiro, RalfFriedl, Anthony Geoghegan, GAD3R Dec 17 at 20:23


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Christopher, Rui F Ribeiro, RalfFriedl

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 4




    There is no "TCP ping" in the way that you seem to think it does exist. ICMP works at Layer 3 (no ports), whereas "TCP ping" connects to any open TCP port, like 80. It's a bit of a misnomer.
    – Christopher
    Dec 17 at 17:20






  • 1




    As @Christopher says, TCP "ping" is just a fancy name for a program that (ab)uses the TCP protocol to confirm if a port listening in that TCP service number is open. So, if you want to provide that service.... The TCP ping "service" per se does not exist. As for disabling ICMP pings in iptables, it is a waste of resources, you have a sysctl kernel setting just for that.
    – Rui F Ribeiro
    Dec 17 at 17:22












  • I want to make sure someone cant check whether the tcp port is open or not
    – Víctor Marcianes
    Dec 17 at 17:38






  • 3




    Are you able to edit the question and explain better what are you after?
    – Rui F Ribeiro
    Dec 17 at 17:51










  • I want to make sure someone cant check whether the tcp port is open or not Why? What's the point of having an open port then? Anyone can test if the port is open simply by trying to connect to it. Anyone you want to give the ability to connect to can easily tell if the port is open.
    – Andrew Henle
    Dec 18 at 0:20














  • 4




    There is no "TCP ping" in the way that you seem to think it does exist. ICMP works at Layer 3 (no ports), whereas "TCP ping" connects to any open TCP port, like 80. It's a bit of a misnomer.
    – Christopher
    Dec 17 at 17:20






  • 1




    As @Christopher says, TCP "ping" is just a fancy name for a program that (ab)uses the TCP protocol to confirm if a port listening in that TCP service number is open. So, if you want to provide that service.... The TCP ping "service" per se does not exist. As for disabling ICMP pings in iptables, it is a waste of resources, you have a sysctl kernel setting just for that.
    – Rui F Ribeiro
    Dec 17 at 17:22












  • I want to make sure someone cant check whether the tcp port is open or not
    – Víctor Marcianes
    Dec 17 at 17:38






  • 3




    Are you able to edit the question and explain better what are you after?
    – Rui F Ribeiro
    Dec 17 at 17:51










  • I want to make sure someone cant check whether the tcp port is open or not Why? What's the point of having an open port then? Anyone can test if the port is open simply by trying to connect to it. Anyone you want to give the ability to connect to can easily tell if the port is open.
    – Andrew Henle
    Dec 18 at 0:20








4




4




There is no "TCP ping" in the way that you seem to think it does exist. ICMP works at Layer 3 (no ports), whereas "TCP ping" connects to any open TCP port, like 80. It's a bit of a misnomer.
– Christopher
Dec 17 at 17:20




There is no "TCP ping" in the way that you seem to think it does exist. ICMP works at Layer 3 (no ports), whereas "TCP ping" connects to any open TCP port, like 80. It's a bit of a misnomer.
– Christopher
Dec 17 at 17:20




1




1




As @Christopher says, TCP "ping" is just a fancy name for a program that (ab)uses the TCP protocol to confirm if a port listening in that TCP service number is open. So, if you want to provide that service.... The TCP ping "service" per se does not exist. As for disabling ICMP pings in iptables, it is a waste of resources, you have a sysctl kernel setting just for that.
– Rui F Ribeiro
Dec 17 at 17:22






As @Christopher says, TCP "ping" is just a fancy name for a program that (ab)uses the TCP protocol to confirm if a port listening in that TCP service number is open. So, if you want to provide that service.... The TCP ping "service" per se does not exist. As for disabling ICMP pings in iptables, it is a waste of resources, you have a sysctl kernel setting just for that.
– Rui F Ribeiro
Dec 17 at 17:22














I want to make sure someone cant check whether the tcp port is open or not
– Víctor Marcianes
Dec 17 at 17:38




I want to make sure someone cant check whether the tcp port is open or not
– Víctor Marcianes
Dec 17 at 17:38




3




3




Are you able to edit the question and explain better what are you after?
– Rui F Ribeiro
Dec 17 at 17:51




Are you able to edit the question and explain better what are you after?
– Rui F Ribeiro
Dec 17 at 17:51












I want to make sure someone cant check whether the tcp port is open or not Why? What's the point of having an open port then? Anyone can test if the port is open simply by trying to connect to it. Anyone you want to give the ability to connect to can easily tell if the port is open.
– Andrew Henle
Dec 18 at 0:20




I want to make sure someone cant check whether the tcp port is open or not Why? What's the point of having an open port then? Anyone can test if the port is open simply by trying to connect to it. Anyone you want to give the ability to connect to can easily tell if the port is open.
– Andrew Henle
Dec 18 at 0:20










1 Answer
1






active

oldest

votes


















6














TCP "ping" is just a fancy name for some programs/a method which (ab)uses the TCP protocol to probe if a port listening in that TCP service number is open.



So, if providing a service for the Internet at large, such as a Web/HTTP Service, there is no way to block that TCP port on particular from answering, if it is listening, or otherwise it will break the inner workings of the TCP/IP protocol.



For a service for restricted/your team use, you can do port knocking to hide it. see Allow SSH access after port knocking from any source IP for an example.



What you can do however, for not having machines scanning all your TCP/IP ports close/open state with success, is creating rules for only allowing incoming connections for your needed services, and DROP the connections to all other TCP ports.



It is important that packets are DROP(ed) and not REJECT(ed). See Is it better to set -j REJECT or -j DROP in iptables?



As for ignoring/dropping ICMP ping requests for the server itself, it makes more sense doing it at kernel level, see How to Disable Ping Response ( ICMP echo ) in Linux all the time?



For further details about the TCP protocol, I advise the reference book "TCP/IP Illustrated, the protocols" 2nd edition, Stevens et al. https://en.wikipedia.org/wiki/TCP/IP_Illustrated



P.S. Needless to say, the best security is not having services open to the Internet at large, in the first place.



Proper enforcing of DMZ - frontend/backend infrastructures, and planning properly a network infrastructure goes a long way. Including security features such as firewall and enforcing VPN use for remote access.






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    6














    TCP "ping" is just a fancy name for some programs/a method which (ab)uses the TCP protocol to probe if a port listening in that TCP service number is open.



    So, if providing a service for the Internet at large, such as a Web/HTTP Service, there is no way to block that TCP port on particular from answering, if it is listening, or otherwise it will break the inner workings of the TCP/IP protocol.



    For a service for restricted/your team use, you can do port knocking to hide it. see Allow SSH access after port knocking from any source IP for an example.



    What you can do however, for not having machines scanning all your TCP/IP ports close/open state with success, is creating rules for only allowing incoming connections for your needed services, and DROP the connections to all other TCP ports.



    It is important that packets are DROP(ed) and not REJECT(ed). See Is it better to set -j REJECT or -j DROP in iptables?



    As for ignoring/dropping ICMP ping requests for the server itself, it makes more sense doing it at kernel level, see How to Disable Ping Response ( ICMP echo ) in Linux all the time?



    For further details about the TCP protocol, I advise the reference book "TCP/IP Illustrated, the protocols" 2nd edition, Stevens et al. https://en.wikipedia.org/wiki/TCP/IP_Illustrated



    P.S. Needless to say, the best security is not having services open to the Internet at large, in the first place.



    Proper enforcing of DMZ - frontend/backend infrastructures, and planning properly a network infrastructure goes a long way. Including security features such as firewall and enforcing VPN use for remote access.






    share|improve this answer




























      6














      TCP "ping" is just a fancy name for some programs/a method which (ab)uses the TCP protocol to probe if a port listening in that TCP service number is open.



      So, if providing a service for the Internet at large, such as a Web/HTTP Service, there is no way to block that TCP port on particular from answering, if it is listening, or otherwise it will break the inner workings of the TCP/IP protocol.



      For a service for restricted/your team use, you can do port knocking to hide it. see Allow SSH access after port knocking from any source IP for an example.



      What you can do however, for not having machines scanning all your TCP/IP ports close/open state with success, is creating rules for only allowing incoming connections for your needed services, and DROP the connections to all other TCP ports.



      It is important that packets are DROP(ed) and not REJECT(ed). See Is it better to set -j REJECT or -j DROP in iptables?



      As for ignoring/dropping ICMP ping requests for the server itself, it makes more sense doing it at kernel level, see How to Disable Ping Response ( ICMP echo ) in Linux all the time?



      For further details about the TCP protocol, I advise the reference book "TCP/IP Illustrated, the protocols" 2nd edition, Stevens et al. https://en.wikipedia.org/wiki/TCP/IP_Illustrated



      P.S. Needless to say, the best security is not having services open to the Internet at large, in the first place.



      Proper enforcing of DMZ - frontend/backend infrastructures, and planning properly a network infrastructure goes a long way. Including security features such as firewall and enforcing VPN use for remote access.






      share|improve this answer


























        6












        6








        6






        TCP "ping" is just a fancy name for some programs/a method which (ab)uses the TCP protocol to probe if a port listening in that TCP service number is open.



        So, if providing a service for the Internet at large, such as a Web/HTTP Service, there is no way to block that TCP port on particular from answering, if it is listening, or otherwise it will break the inner workings of the TCP/IP protocol.



        For a service for restricted/your team use, you can do port knocking to hide it. see Allow SSH access after port knocking from any source IP for an example.



        What you can do however, for not having machines scanning all your TCP/IP ports close/open state with success, is creating rules for only allowing incoming connections for your needed services, and DROP the connections to all other TCP ports.



        It is important that packets are DROP(ed) and not REJECT(ed). See Is it better to set -j REJECT or -j DROP in iptables?



        As for ignoring/dropping ICMP ping requests for the server itself, it makes more sense doing it at kernel level, see How to Disable Ping Response ( ICMP echo ) in Linux all the time?



        For further details about the TCP protocol, I advise the reference book "TCP/IP Illustrated, the protocols" 2nd edition, Stevens et al. https://en.wikipedia.org/wiki/TCP/IP_Illustrated



        P.S. Needless to say, the best security is not having services open to the Internet at large, in the first place.



        Proper enforcing of DMZ - frontend/backend infrastructures, and planning properly a network infrastructure goes a long way. Including security features such as firewall and enforcing VPN use for remote access.






        share|improve this answer














        TCP "ping" is just a fancy name for some programs/a method which (ab)uses the TCP protocol to probe if a port listening in that TCP service number is open.



        So, if providing a service for the Internet at large, such as a Web/HTTP Service, there is no way to block that TCP port on particular from answering, if it is listening, or otherwise it will break the inner workings of the TCP/IP protocol.



        For a service for restricted/your team use, you can do port knocking to hide it. see Allow SSH access after port knocking from any source IP for an example.



        What you can do however, for not having machines scanning all your TCP/IP ports close/open state with success, is creating rules for only allowing incoming connections for your needed services, and DROP the connections to all other TCP ports.



        It is important that packets are DROP(ed) and not REJECT(ed). See Is it better to set -j REJECT or -j DROP in iptables?



        As for ignoring/dropping ICMP ping requests for the server itself, it makes more sense doing it at kernel level, see How to Disable Ping Response ( ICMP echo ) in Linux all the time?



        For further details about the TCP protocol, I advise the reference book "TCP/IP Illustrated, the protocols" 2nd edition, Stevens et al. https://en.wikipedia.org/wiki/TCP/IP_Illustrated



        P.S. Needless to say, the best security is not having services open to the Internet at large, in the first place.



        Proper enforcing of DMZ - frontend/backend infrastructures, and planning properly a network infrastructure goes a long way. Including security features such as firewall and enforcing VPN use for remote access.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 18 at 22:59

























        answered Dec 17 at 19:57









        Rui F Ribeiro

        39k1479129




        39k1479129















            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre