Ask Your Question

How I block internet access for a concrete program?

asked 2014-07-20 06:30:15 -0500

Holis gravatar image

I need block internet access for a program but i don't know why I can configure the firewall for it can do it

edit retag flag offensive close merge delete


Please give more detail on what exactly you want to achieve: deny outgoing connections to a program? Which program? Who will run this program? The firewall is probably not able to do what you need, but "unshare -n <program>" may fit your need, or maybe you need to create a SELinux module for this.</program>

tonioc gravatar imagetonioc ( 2014-07-20 07:21:18 -0500 )edit

What's the thing, @tonioc? LOL

abadrinath gravatar imageabadrinath ( 2014-07-24 05:33:25 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-07-23 05:27:24 -0500

The most secure solution is probably (as I've done this on FreeBSD Jails but not on Fedora) is to put the application in an LXC app container and disable network for that container.

edit flag offensive delete link more

answered 2014-07-20 09:50:55 -0500

FranciscoD_ gravatar image

Hi! Welcome to Ask Fedora!

If you can ascertain what ports your program uses, you should be able to block these and as a result block access to your program.

Please take a minute out to read through the forum guidelines here:

edit flag offensive delete link more


Can you elaborate on how a user can find the ports that a program uses ? Thanks.

NickTux gravatar imageNickTux ( 2014-07-20 14:26:45 -0500 )edit

I didn't add the info because I'm not aware of a standard way of doing this. More often than not you need to read the documentation which may or many not list the required ports. Some applications also use dynamic ports when required, in which case it's much harder to pin down one port. :(

FranciscoD_ gravatar imageFranciscoD_ ( 2014-07-20 19:17:04 -0500 )edit

Maybe add the netstat -anp|more command to the answer?

abadrinath gravatar imageabadrinath ( 2014-07-26 01:01:07 -0500 )edit

Question Tools

1 follower


Asked: 2014-07-20 06:30:15 -0500

Seen: 1,630 times

Last updated: Jul 23 '14