You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple yet powerful tun/tap event emitter. Could be used like VPN dispatcher...
3
+
Simple yet powerful event emitter by **tun/tap** (with/without **pcap** filter) or **nflog** source. Could be used as: VPN dispatcher, simplified detection system, by demand services handler, etc...
4
4
5
-
### How it works:
6
-
You should create and configure tun/tap device, then run **tuninetd**. It starts listening on that interface until network traffic will be detected. After that, interface will be released and certain command executed. From now on daemon is in monitoring state.
7
-
After N seconds of interface idle, tuninetd send "stop" command by path that you define and start listening interface by its own again.
8
-
9
-
Since **tuninetd** based on **libpcap**, you can specify filter to trigging "start" and monitoring iddle (i.e. cutoff unwanted traffic). To test/debug pcap rules you might use tcpdump which is based on the same library.
5
+
### 1. How it works.
6
+
#### tun/tap device: ####
7
+
You should create and configure tun/tap device first, then run **tuninetd**. It starts listening on this interface, until network traffic will be detected. After that, interface immediately releasing and specified command (with -c) will execute. From now on, daemon in monitoring state.
10
8
11
-
**! OR !**
9
+
---
10
+
>For example:
11
+
```sh
12
+
# tuninetd -i tun0 -c /path/to/launcher
13
+
```
14
+
>then "start" command from **tuninetd** will be:
15
+
```sh
16
+
# /path/to/launcher start > /dev/null 2>&1
17
+
```
18
+
>"stop" command in the same manner.
19
+
---
12
20
13
-
You can simply use netfilter nfgroup (*iptables NFLOG target*), for reading packets from. No need binding to tun/tap interface nor heavy libpcap sensor. This is more lightweight mode and because of that - more reliable. Option available since v1.1.0.
21
+
After -t seconds of interface idle (no packets through), tuninetd send "stop" command by path that defined with -c, and start listening interface by itself again.
14
22
23
+
Since **tuninetd** based on **libpcap**, you can specify capture filter. To test pcap rules might use tcpdump which is based on the same library.
15
24
16
-
**tuninetd**allows deploy "VPN by demand" or any other "by demand" services, which is the main idea of the project.
25
+
>**! Notice !***Modern Linux distributions periodically send 'icmpv6 router solicitation' packets, which cause tuninetd keep or change state. This situation appears in tun/tap mode without pcap filter applied.*
17
26
18
-
### Installation:
27
+
#### NFLOG: ####
28
+
29
+
In general, behavior the same as tun/tap in part of start/stop. You could simply use netfilter nfgroup (*iptables **NFLOG** target*) to reading packets from. No binding to tun/tap device nor libpcap sensor. This is more lightweight mode and, because of that, - more reliable.
30
+
31
+
### 2. Installation:
19
32
If you're using Debian/Ubuntu please check deb-packages folder. Choose appropriate architecture, then run following command with root privileges:
20
33
```sh
21
34
# dpkg -i tuninetd_ver_arch.deb
@@ -27,9 +40,9 @@ To install from sources download src folder. In case Debian/Ubuntu, you should a
27
40
# make
28
41
```
29
42
30
-
Congrats! Tuninend is ready to use. Check ./bin folder. :)
43
+
Congrats! Tuninend ready to use. Check ./bin folder.
@@ -56,13 +69,11 @@ Check ```example``` folder to find some shell scripts.
56
69
57
70
To create and bring up ```tun``` device, could be used following commands:
58
71
```sh
59
-
# ip tuntap add name tun0 mode tun
72
+
# ip tuntap add dev tun0 mode tun
60
73
# ip link set tun0 up
61
74
```
62
75
63
-
For more information about routing and configuring net devices, I strongly suggest LARCT how-to.
64
-
65
-
*! Notice ! Modern Linux distributions periodically send 'icmpv6 router solicitation' packets, which cause tuninetd keep or change its status (calling 'start' script for example). This situation appears in tun/tap mode without pcap filter applied.*
76
+
For more information about routing and configuring network devices, I strongly suggest LARCT how-to.
0 commit comments