[GH-ISSUE #253] Block port access #180

Closed
opened 2026-05-05 05:15:28 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @tinfoil123 on GitHub (Jan 22, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/253

How do I stop a firejailed program from accessing port X?

Originally created by @tinfoil123 on GitHub (Jan 22, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/253 How do I stop a firejailed program from accessing port X?
gitea-mirror 2026-05-05 05:15:28 -06:00
Author
Owner

@netblue30 commented on GitHub (Jan 23, 2016):

You need to create a network namespace and install your own iptables filter. Example:

$ firejail --net=eth0 --netfilter=/etc/firejail/nolocal.net firefox

I have some sample netfilters in /etc/firejail/*.net. Take one of them and modify it. It has the same syntax as iptables - in fact I am using iptables-restore to install the filter inside the sandbox.

<!-- gh-comment-id:174194991 --> @netblue30 commented on GitHub (Jan 23, 2016): You need to create a network namespace and install your own iptables filter. Example: $ firejail --net=eth0 --netfilter=/etc/firejail/nolocal.net firefox I have some sample netfilters in /etc/firejail/*.net. Take one of them and modify it. It has the same syntax as iptables - in fact I am using iptables-restore to install the filter inside the sandbox.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#180
No description provided.