Firejail: Add support for ipvlan interfaces

Created on 4 Jun 2018  路  7Comments  路  Source: netblue30/firejail

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

Most helpful comment

All in mainline, you can try it out, in your case:
$ firejail --net=wlp3s0 firefox

All 7 comments

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

All in mainline, you can try it out, in your case:
$ firejail --net=wlp3s0 firefox

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?

@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?

@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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

reinerh picture reinerh  路  3Comments

ghost picture ghost  路  3Comments

dandelionred picture dandelionred  路  3Comments

bryce-lynch picture bryce-lynch  路  4Comments

ghost picture ghost  路  3Comments