4

I know I can use the below command to block a single ip:

firewall-cmd --permanent --add-rich-rule="rule family='ipv4' source address='115.239.228.12' reject"

but I need to block all ips starting from 115.239.x.x

I am having Cent os 7.

Thanks

3
  • 3
    I haven't used firewalld, but have you simply tried providing a cidr specification? 115.239.0.0/16?
    – Zoredache
    Mar 20, 2015 at 18:06
  • Sounds reasonable. It's the first thing I would try. Mar 20, 2015 at 18:11
  • @Zoredache And you are right Mar 20, 2015 at 18:14

1 Answer 1

6

I am not a user of firewalld myself, but for most firewall implementations, particularly linux-based ones, whenever you see the option for a source or destination address you can simply provide a CIDR style network specification. So 115.239.0.0/16.

You must log in to answer this question.

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