0

I am trying to block ICMP to an incoming subnet, lets say this is 1.0.0.0/24

I am currently using Linux (Ubuntu 20.04) with a basic ufw setup. Right now people can ping an address like 1.0.0.0, how can I make the firewall block incoming ICMP requests to that subnet?

Thanks

4
  • Or what would be better, is to restrict ICMP to a specific IP Address. Eg: Only 3.3.3.3 can ping 1.0.0.0
    – Zane
    Oct 10, 2020 at 0:13
  • Is this Ubuntu box the router for your network? Please share your network topology. Oct 10, 2020 at 9:02
  • I basically just have a normal Ubuntu box, nothing major running on it. I have a /24 routed on it, and I would like to block ICMP only to the /24, as I have other IP addresses which should allow ICMP, or at least to ban it except when coming from a specific IP.
    – Zane
    Oct 11, 2020 at 9:53
  • Can you show a diagram of the setup? It is still hard to see from your description what the network structure actually is. Oct 11, 2020 at 10:01

1 Answer 1

0
$ sudo iptables -A INPUT -d 1.0.0.0/24 -p icmp --icmp-type echo-request -j REJECT

Any ICMP echo requests destined to 1.0.0.0/24 network will be discarded by the firewall

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .