mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #974] gateway in sandbox depends on --net parameters order #663
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#663
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 @djfd on GitHub (Dec 13, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/974
Hi,
not sure if it is a bug or feature, but gateway it being taken from the first specified
--netargumentwhen there is two interfaces (eg
wiredandwireless) it is possible that only one is active (or has gateway to external nets), saywiredone. under these conditions host networking is still okay, and, also it works for a sandbox if running it asfirejail --net=wired --net=wireless ...joining to sandboxed network shows
however if we run it with a reversed params, ie.
firejail --net=wireless --net=wired ...then there is not any default gw at all
For me it looks as a bug, but if it is actually feature, then could you please extend
--defaultgwparameter to support something like toinheritedthanks
@netblue30 commented on GitHub (Dec 13, 2016):
The problem is you can have several default gateways defined in your routing table, and not all of the make sense in the new network namespace. Currently, the code picks up a default gateway associated with the first --net interface. I would say you need to specify your gateway with --defaultgw=10.0.3.2. I'll mark it as an enhancement, maybe I can come up with something better.
Question: is --net=wireless working? Can you get any traffic on it?
@djfd commented on GitHub (Dec 13, 2016):
yes, both networks are working.
I need to say that this all is under virtual box, one of the interfaces is attached to host-only adapter (used for ssh-ing the guest, and similar), and second one is NAT interface to host (this way internet is accessible to the guest)
there is that I can see under
/proc/self/net/routebut issue will arise when I move that guest image to real hardware, with ethernet and wireless adapters: I cannot predict when what of them is in use thus cannot create simple shortcut for launching the sandbox... that is why
UPD
An ideally, there have to be some watchdog waiting for a host gateway changes to propagate them to a sandbox. I mean if I set the gateway to be inherited (or leave it empty), then updating of sandbox gw need to be done transparently. just IMHO
@netblue30 commented on GitHub (Dec 14, 2016):
In this moment we support for --net command only wired ethernet and bridge kernel interfaces. Wireless interfaces are not supported - it would probably require some sort of kernel macvlan module for wireless. This is why is breaking when you move from VirtualBox to the real driver. Anyway, you rise some valid points, I will probably have to rework the assignment of default gateway.