From 30ae9dfda3788cdfaf1b84d124dbc7feb638c77b Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Thu, 3 Jul 2014 13:34:11 +0530 Subject: networkd: Introduce tun/tap device This patch introduces TUN/TAP device creation support to networkd. Example conf to create a tap device: file: tap.netdev ------------------ [NetDev] Name=tap-test Kind=tap [Tap] OneQueue=true MultiQueue=true PacketInfo=true User=sus Group=sus ------------------ Test: 1. output of ip link tap-test: tap pi one_queue UNKNOWN_FLAGS:900 user 1000 group 1000 id: uid=1000(sus) gid=10(wheel) groups=10(wheel),1000(sus) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 Modifications: Added: 1. file networkd-tuntap.c 3. netdev kind NETDEV_KIND_TUN and NETDEV_KIND_TAP 2. Tun and Tap Sections and config params to parse conf and gperf conf parameters [tomegun: tweak the 'kind' checking for received ifindex] --- man/systemd.netdev.xml | 115 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) (limited to 'man') diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index 5d033e77d3..a57ba7ad8c 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -339,6 +339,112 @@ + + [TUN] Section Options + + The [TUN] section only applies for netdevs of kind + tun, and accepts the following keys: + + + + OneQueue= + Takes a boolean argument. Configures whether + to enable disable one queue . it determines whether all packets + queue at the device (enabled), or a fixed number queue at the device and + the rest at the "qdisc". Defaults to no. + + + + MultiQueue= + Takes a boolean argument. Configures whether the + to disable or disable . Linux supports multiqueue tuntap which can + uses multiple file descriptors (queues) to parallelize + packets sending or receiving. The device allocation is the same as before, + and if user wants to create multiple queues. Defaults to + no. + + + + PacketInfo= + Takes a boolean argument. Configures whether the + to enable or disable . PacketInfo tells the kernel to not provide packet + information. The purpose of PacketInfo is to tell the kernel that packets + will be "pure" IP packets, with no added bytes. Otherwise (if PacketInfo is unset), + 4 extra bytes are added to the beginning of the packet (2 flag bytes and 2 protocol bytes). + Defaults to no. + + + + User= + User to be allowed to access this device. Give ownership to unprivileged users, + so that /dev/net/tun device to be usable by this user. + + + + + Group= + Group to be allowed to access this device. Give ownership to unprivileged group, + so that /dev/net/tun device to be usable by this group. + + + + + + + + + [TAP] Section Options + + The [TAP] section only applies for netdevs of kind + tap, and accepts the following keys: + + + + + OneQueue= + Takes a boolean argument. Configures whether + to enable disable one queue . it determines whether all packets + queue at the device (enabled), or a fixed number queue at the device and + the rest at the "qdisc". Defaults to no. + + + + MultiQueue= + Takes a boolean argument. Configures whether the + to disable or disable . From version 3.8, Linux supports multiqueue + tuntap which can uses multiple file descriptors (queues) to parallelize + packets sending or receiving. The device allocation is the same as before, + and if user wants to create multiple queues. Defaults to + no. + + + + PacketInfo= + Takes a boolean argument. Configures whether the + to enable or disable . PacketInfo tells the kernel to not provide packet + information. The purpose of PacketInfo is to tell the kernel that packets + will be "pure" IP packets, with no added bytes. Otherwise (if PacketInfo is unset), + 4 extra bytes are added to the beginning of the packet (2 flag bytes and 2 protocol bytes). + Defaults to no. + + + + User= + User to be allowed to access this device. Give ownership to unprivileged users, + so that /dev/net/tun device to be usable by this user. + + + + + Group= + Group to be allowed to access this device. Give ownership to unprivileged group, + so that /dev/net/tun device to be usable by this group. + + + + + + Example @@ -374,6 +480,15 @@ Local=192.168.223.238 Remote=192.169.224.239 TTL=64 + + /etc/systemd/network/tap.netdev + [NetDev] +Name=tap-test +Kind=tap + +[Tap] +MultiQueue=true +PacketInfo=true /etc/systemd/network/sit.netdev -- cgit v1.2.3-54-g00ecf