Skip to content

Commit affb59e

Browse files
elmarcopoettering
authored andcommitted
network: add TUN/TAP vt-* network rule for VMs
VM typically use a TAP device, and work similarly to a veth device from the host side.
1 parent 3db1c62 commit affb59e

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

network/80-vm-vt.network

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-License-Identifier: LGPL-2.1+
2+
#
3+
# This file is part of systemd.
4+
#
5+
# systemd is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU Lesser General Public License as published by
7+
# the Free Software Foundation; either version 2.1 of the License, or
8+
# (at your option) any later version.
9+
10+
# This network file matches vt-* TUN/TAP devices and applies a similar
11+
# configuration as ve-* to provide NAT/DHCP to VMs.
12+
13+
[Match]
14+
Name=vt-*
15+
Driver=tun
16+
17+
[Network]
18+
# Default to using a /28 prefix, giving up to 13 addresses per VM.
19+
Address=0.0.0.0/28
20+
LinkLocalAddressing=yes
21+
DHCPServer=yes
22+
IPMasquerade=yes
23+
LLDP=yes
24+
EmitLLDP=customer-bridge

network/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ if conf.get('ENABLE_NETWORKD') == 1
44
install_data('80-container-host0.network',
55
'80-container-ve.network',
66
'80-container-vz.network',
7+
'80-vm-vt.network',
78
'80-wifi-adhoc.network',
89
'80-wifi-ap.network.example',
910
'80-wifi-station.network.example',

0 commit comments

Comments
 (0)