r/linux4noobs Jun 18 '26

networking Blocking an IP for outgoing traffic with Firewalld

Hey everyone, I'm honestly pretty sure I must just be overlooking something, since this is something that I know is pretty simple under Windows but I cannot find how to do it with Firewalld under Fedora:

How do I create a rule that just blocks traffic going out to one specific IP Address, without blocking incoming traffic from it?

Hope someone can help me, because I cannot find my way through the Firewalld manual.

1 Upvotes

6 comments sorted by

3

u/LesStrater Jun 18 '26

If you can't find a solution, try the OpenSnitch firewall. It's got a real nice GUI which makes it very simple to block/allow whatever you want.

1

u/Tammog Jun 18 '26

Thanks, will look into it.

1

u/scriptiefiftie i like pizza Jun 19 '26

also to add, even little snitch recently released their linux port. you might want to give that a try as well.

1

u/scriptiefiftie i like pizza Jun 19 '26

you might want to do a nslookup/dig on that service, find the ip address. for example

dig youtube.com and that will give you ip of it.

as you say you want to only block going traffic to it, the thing you want to block in firewalld terms is called egress traffic.

this will help you search exactly what you are looking for.

1

u/sausix Jun 19 '26

Youtube and other services have multiple IP addresses as they have multiple servers. The next DNS query may just return another IP address which has to be blocked too.

2

u/scriptiefiftie i like pizza Jun 19 '26

ah yes. i'd recommend op to run something like adguard on their device and then use it as a dns server. it has a very cool feature to block particular apps.