support tap mac addr
This commit is contained in:
parent
0d9e299595
commit
3d27f32c03
1 changed files with 3 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ let
|
|||
{
|
||||
name = lanName;
|
||||
iface = tapInterfaceName;
|
||||
mac = tapCfg.mac;
|
||||
create = ''
|
||||
ip tuntap add dev ${tapInterfaceName} mode tap
|
||||
ip link set dev ${tapInterfaceName} up
|
||||
|
|
@ -36,6 +37,7 @@ let
|
|||
{
|
||||
name = macvtapName;
|
||||
iface = macvtapInterfaceName;
|
||||
mac = macvtapCfg.mac;
|
||||
create = ''
|
||||
ip link add link ${macvtapNetworkCfg.uplink.iface} name ${macvtapInterfaceName} type macvtap mode bridge
|
||||
ip link set ${macvtapInterfaceName} netns ${netName}.vmix
|
||||
|
|
@ -86,7 +88,7 @@ let
|
|||
-virtfs local,path=${toString shareCfg.source},security_model=passthrough,mount_tag=${shareCfg.target} \
|
||||
'') (attrValues vmCfg.shares)} \
|
||||
${concatMapStrings (tapCfg: ''
|
||||
-device virtio-net-pci,netdev=lan-${tapCfg.name} \
|
||||
-device virtio-net-pci,netdev=lan-${tapCfg.name},mac=${tapCfg.mac} \
|
||||
-netdev tap,id=lan-${tapCfg.name},ifname=${tapCfg.iface},script=no,downscript=no \
|
||||
'') allTaps} \
|
||||
${optionalString cfg.network.user.enable "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue