15
modules/vlan/service.nix
Normal file
15
modules/vlan/service.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
liminix
|
||||
, lib
|
||||
}:
|
||||
{ ifname, primary, vid } :
|
||||
let
|
||||
inherit (liminix.services) oneshot;
|
||||
in oneshot rec {
|
||||
name = "${ifname}.link";
|
||||
up = ''
|
||||
ip link add link $(output ${primary} ifname) name ${ifname} type vlan id ${vid}
|
||||
${liminix.networking.ifup name ifname}
|
||||
'';
|
||||
down = "ip link set down dev ${ifname}";
|
||||
}
|
Reference in New Issue
Block a user