Firewall Block Country

Is it possible to block by country but give way to an IP from a blocked country?


welcome to the IPFire community, and sorry for my late response. :slight_smile:

Yes, this is possible. To do so, you will have to create a firewall rule permitting traffic from or to (your question did not specify that) the specific IP address. Then, you need to create a second rule that forbids any traffic from or to the country that IP address is located in.

Please refer to the firewall documentation for more basic information, and let us know if anything remains unclear.

Thanks, and best regards,
Peter Müller

Thank you very much for the reply, Peter.

What I need is to let the IP pass through, for example,, which is from, let’s say, Portugal, but prohibit the rest of the IP’s from Portugal.

Peter explained it. Make a rule (1) that allows and then make a rule (2) that blocks Portugal. The rules are applied in the order of the rules.


Thanks !!!

this is exactly what i did and it works perfectly.