Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ipvlan interfaces #1978

Closed
ValdikSS opened this issue Jun 4, 2018 · 7 comments
Closed

Add support for ipvlan interfaces #1978

ValdikSS opened this issue Jun 4, 2018 · 7 comments

Comments

@ValdikSS
Copy link
Contributor

ValdikSS commented Jun 4, 2018

Firejail adds new macvlan interface when --net option is specified. While macvlan is a best choice for Ethernet interfaces, it doesn't work with 802.11 Wi-Fi.
Right now there's no easy way to use Wi-Fi with Firejail. Documentation describes routed setup, which @netblue30 recommends to use in #1600.
Linux kernel contains another interface driver which is very similar to macvlan and works with Wi-Fi: ipvlan. Contrary to macvlan, it shares the same MAC address as the master interface, which allows it to be used with 802.11.

@netblue30, is it possible to auto-detect interface type and use either macvlan for Ethernet and ipvlan for 802.11?

Here's how you can create this interface and use it in Firejail:

sudo ip link add link wlp3s0 firewifi type ipvlan mode l2; sudo ip link set firewifi up; sudo ip addr add 192.168.0.199/24 dev firewifi
firejail --interface=firewifi --noprofile
@netblue30 netblue30 added the enhancement New feature request label Jun 4, 2018
@netblue30
Copy link
Owner

Let me give it a try, thanks for the idea!

@netblue30 netblue30 added in testing A bugfix that is being tested and removed enhancement New feature request labels Jun 12, 2018
@netblue30
Copy link
Owner

All in mainline, you can try it out, in your case:

$ firejail --net=wlp3s0 firefox

@chiraag-nataraj
Copy link
Collaborator

chiraag-nataraj commented Jul 9, 2018

Hmm, I tried something as simple as firejail --noprofile --net=wlp60s0 and wasn't able to connect with the outside world. Trying to ping a host would resolve but time out with destination unreachable. Am I doing something wrong? Is there some extra preparation that needs to happen for this to work properly?

@ValdikSS
Copy link
Contributor Author

@netblue30 it indeed doesn't work for some reason. It doesn't add default route, but adding it manually does not fix the issue. Are you sure you set up ipvlan of type l2?

@ValdikSS
Copy link
Contributor Author

@netblue30 I can't see where IPVLAN_MODE_L2 is defined. It looks like there are no changes to automake/autoconf, and nobody defines it.

@netblue30
Copy link
Owner

Something didn't got merged! Let me take a look, thanks!

@netblue30
Copy link
Owner

Should be all fixed now: b78cc58

@Vincent43 Vincent43 removed the in testing A bugfix that is being tested label Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants