Skip to content

Commit 9ec47ee

Browse files
committed
tinc-vpn:T766:Initial support for tinc VPN
1 parent 741cd00 commit 9ec47ee

File tree

13 files changed

+962
-2
lines changed

13 files changed

+962
-2
lines changed

data/configd-include.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"interfaces-wireguard.py",
2727
"interfaces-wireless.py",
2828
"interfaces-wirelessmodem.py",
29+
"interfaces-tinc.py",
2930
"ipsec-settings.py",
3031
"lldp.py",
3132
"nat.py",
@@ -60,4 +61,4 @@
6061
"vrf.py",
6162
"vrrp.py",
6263
"vyos_cert.py"
63-
]
64+
]

data/templates/tinc/hosts_config.tmpl

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% for prefix in subnets %}
2+
Subnet = {{ prefix }}
3+
{% endfor %}
4+
{% for addr in local_address %}
5+
Address = {{ addr }}
6+
{% endfor %}
7+
Port = {{ port }}
8+

data/templates/tinc/tinc-down.tmpl

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
ip link set {{ ifname }} down

data/templates/tinc/tinc-up.tmpl

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
{% for addr in address %}
3+
ip addr add dev {{ ifname }} local {{ addr }}
4+
{% endfor %}
5+
ip link set {{ ifname }} up

data/templates/tinc/tinc.conf.tmpl

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
Name = {{ node_name }}
2+
Interface = {{ ifname }}
3+
Mode = {{ device.mode }}
4+
Compression = {{ compression_level }}
5+
Cipher = {{ encryption.cipher }}
6+
Digest = {{ encryption.digset }}
7+
{% if resolve_hostname %}
8+
Hostnames = yes
9+
{% else %}
10+
Hostnames = no
11+
{% endif %}
12+
PrivateKeyFile = {{ private_keyfile }}
13+
Broadcast = {{ broadcast_type }}
14+
{% if disable_resolve_hostname %}
15+
DecrementTTL = no
16+
{% else %}
17+
DecrementTTL = yes
18+
{% endif %}
19+
{% if direct_only %}
20+
DirectOnly = yes
21+
{% else %}
22+
DirectOnly = no
23+
{% endif %}
24+
Forwarding = {{ forwarding_option }}
25+
{% if iff_One_Queue %}
26+
IffOneQueue = yes
27+
{% else %}
28+
IffOneQueue = no
29+
{% endif %}
30+
KeyExpire = {{ key_expire }}
31+
{% if local_discovery %}
32+
LocalDiscovery = yes
33+
{% else %}
34+
LocalDiscovery = no
35+
{% endif %}
36+
MACExpire = {{ mac_expire}}
37+
MaxTimeout = {{ max_timeout }}
38+
PingInterval = {{ ping_interval }}
39+
PingTimeout = {{ ping_timeout }}
40+
{% if priority_inheritance %}
41+
PriorityInheritance = yes
42+
{% else %}
43+
PriorityInheritance = no
44+
{% endif %}
45+
ProcessPriority = {{ priority }}
46+
ReplayWindow = {{ replay_window }}
47+
{% if strict_subnets %}
48+
StrictSubnets = yes
49+
{% else %}
50+
StrictSubnets = no
51+
{% endif %}
52+
{% if tunnel_server %}
53+
TunnelServer = yes
54+
{% else %}
55+
TunnelServer = no
56+
{% endif %}
57+
{% if clamp_mss %}
58+
ClampMSS = yes
59+
{% else %}
60+
ClampMSS = no
61+
{% endif %}
62+
{% if indirect_data %}
63+
IndirectData = yes
64+
{% else %}
65+
IndirectData = no
66+
{% endif %}
67+
MACLength = {{ mac_length }}
68+
PMTU = {{ mtu }}
69+
{% if disable_PMTU_Discovery %}
70+
PMTUDiscovery = no
71+
{% else %}
72+
PMTUDiscovery = yes
73+
{% endif %}
74+
{% if TCP_Only %}
75+
TCPonly = yes
76+
{% else %}
77+
TCPonly = no
78+
{% endif %}
79+
DeviceType = {{ device.type }}
80+
{% if udp_rcv_buf %}
81+
UDPRcvBuf = {{ udp_rcv_buf }}
82+
{% endif %}
83+
{% if udp_snd_buf %}
84+
UDPSndBuf = {{ udp_snd_buf }}
85+
{% endif %}
86+
{% if proxy and proxy.type %}
87+
{% if proxy.type == 'socks5' %}
88+
Proxy = {{ proxy.type }} {{ proxy.address }} {{ proxy.port }} {{ proxy.username }} { proxy.password }}
89+
{% elif proxy.type == 'socks4' %}
90+
Proxy = {{ proxy.type }} {{ proxy.address }} {{ proxy.port }}{{ proxy.username }}
91+
{% elif proxy.type == 'http' %}
92+
Proxy = {{ proxy.type }} {{ proxy.address }} {{ proxy.port }}
93+
{% elif proxy.type == 'exec' %}
94+
Proxy = {{ proxy.type }} {{ proxy.exec }}
95+
{% endif %}
96+
{% endif %}
97+
{% if connect %}
98+
ConnectTo = {{ connect }}
99+
{% endif %}
100+
{% if bind_address %}
101+
BindToAddress = {{ bind_address }}
102+
{% endif %}
103+
{% if bind_interface %}
104+
BindToInterface = {{ bind_interface }}
105+
{% endif %}
106+
{% if graph_dump_file %}
107+
GraphDumpFile = {{ graph_dump_file }}
108+
{% endif %}

debian/control

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ Depends:
112112
wireguard-tools,
113113
wireguard-modules,
114114
wireless-regdb,
115-
wpasupplicant (>= 0.6.7)
115+
wpasupplicant (>= 0.6.7),
116+
tinc
116117
Description: VyOS configuration scripts and data
117118
VyOS configuration scripts, interface definitions, and everything
118119

0 commit comments

Comments
 (0)