mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2107] Firejail with iptables for LAN only doesn't work #1425
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#1425
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @greencopper on GitHub (Sep 6, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2107
I am trying to jail a game so that only LAN is visible.
I am running firejail like this:
Then I have an iptables script that looks like this:
If I change the default policy to "ACCEPT" then the games on the LAN can see each other, but once I set the default policy to "DROP" and then only accept the specific IP range of 192.168.1.0/24, then they cannot see each other.
Is this a firejail issue?
How do I set this up correctly so that LAN ONLY is working?
@reinerh commented on GitHub (Sep 7, 2018):
Do those rules work outside of firejail?
And when you run
firejail --noprofile --net=enp3s0 --netfilter=firejail-only-local.net /sbin/ifconfigdoes it have an IP address from the same range?@greencopper commented on GitHub (Sep 8, 2018):
Yes to both.
@netblue30 commented on GitHub (Sep 9, 2018):
I am on Debian, kernel 4.9. It looks like the format of the first 4 lines in your filter is bad:
It complains about "iptables-restore: line 2 failed". It looks like the format used by iptables-save/iptables-restore is a little different than the regular iptables format. You need to replace the lines with the following:
You also need to take in account your DNS setting. If you have your DNS set for your home router at 192.168.1.1, the DNS requests will still go out. Example:
So the guy managed to resolve google.com, but was not able to send anything out.
@chiraag-nataraj commented on GitHub (Oct 3, 2018):
@greencopper did @netblue30's suggestion work?
@rusty-snake commented on GitHub (Jun 26, 2019):
@greencopper I'm closing here due to inactivity, please fell free to reopen if you have more questions.