Skip to content

Commit

Permalink
tinc-vpn:T766:Initial support for tinc VPN
Browse files Browse the repository at this point in the history
  • Loading branch information
jack9603301 committed Oct 15, 2020
1 parent 741cd00 commit 195cc7a
Show file tree
Hide file tree
Showing 13 changed files with 1,130 additions and 2 deletions.
3 changes: 2 additions & 1 deletion data/configd-include.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"interfaces-wireguard.py",
"interfaces-wireless.py",
"interfaces-wirelessmodem.py",
"interfaces-tinc.py",
"ipsec-settings.py",
"lldp.py",
"nat.py",
Expand Down Expand Up @@ -60,4 +61,4 @@
"vrf.py",
"vrrp.py",
"vyos_cert.py"
]
]
8 changes: 8 additions & 0 deletions data/templates/tinc/hosts_config.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% for prefix in subnets %}
Subnet = {{ prefix }}
{% endfor %}
{% for addr in local_address %}
Address = {{ addr }}
{% endfor %}
Port = {{ port }}

2 changes: 2 additions & 0 deletions data/templates/tinc/tinc-down.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
ip link set {{ ifname }} down
5 changes: 5 additions & 0 deletions data/templates/tinc/tinc-up.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
{% for addr in address %}
ip addr add dev {{ ifname }} local {{ addr }}
{% endfor %}
ip link set {{ ifname }} up
60 changes: 60 additions & 0 deletions data/templates/tinc/tinc.conf.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Name = {{ node_name }}
Interface = {{ ifname }}
Mode = {{ device.mode }}
Compression = {{ compression_level }}
Cipher = {{ encryption.cipher }}
Digest = {{ encryption.digset }}
Hostnames = {{ resolve_hostname }}
PrivateKeyFile = {{ private_keyfile }}
Broadcast = {{ broadcast_type }}
DecrementTTL = {{ decrement_ttl }}
DirectOnly = {{ direct_only }}
Forwarding = {{ forwarding_option }}
IffOneQueue = {{ iff_One_Queue }}
KeyExpire = {{ key_expire }}
LocalDiscovery = {{ local_discovery }}
MACExpire = {{ mac_expire}}
MaxTimeout = {{ max_timeout }}
PingInterval = {{ ping_interval }}
PingTimeout = {{ ping_timeout }}
PriorityInheritance = {{ priority_inheritance }}
ProcessPriority = {{ priority }}
ReplayWindow = {{ replay_window }}
StrictSubnets = {{ strict_subnets }}
TunnelServer = {{ tunnel_server }}
ClampMSS = {{ clamp_mss }}
IndirectData = {{ indirect_data }}
MACLength = {{ mac_length }}
PMTU = {{ mtu }}
PMTUDiscovery = {{ PMTU_Discovery }}
TCPonly = {{ TCP_Only }}
DeviceType = {{ device.type }}
{% if udp_rcv_buf %}
UDPRcvBuf = {{ udp_rcv_buf }}
{% endif %}
{% if udp_snd_buf %}
UDPSndBuf = {{ udp_snd_buf }}
{% endif %}
{% if proxy and proxy.type %}
{% if proxy.type == 'socks5' %}
Proxy = {{ proxy.type }} {{ proxy.address }} {{ proxy.port }} {{ proxy.username }} { proxy.password }}
{% elif proxy.type == 'socks4' %}
Proxy = {{ proxy.type }} {{ proxy.address }} {{ proxy.port }}{{ proxy.username }}
{% elif proxy.type == 'http' %}
Proxy = {{ proxy.type }} {{ proxy.address }} {{ proxy.port }}
{% elif proxy.type == 'exec' %}
Proxy = {{ proxy.type }} {{ proxy.exec }}
{% endif %}
{% endif %}
{% if connect %}
ConnectTo = {{ connect }}
{% endif %}
{% if bind_address %}
BindToAddress = {{ bind_address }}
{% endif %}
{% if bind_interface %}
BindToInterface = {{ bind_interface }}
{% endif %}
{% if graph_dump_file %}
GraphDumpFile = {{ graph_dump_file }}
{% endif %}
3 changes: 2 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ Depends:
wireguard-tools,
wireguard-modules,
wireless-regdb,
wpasupplicant (>= 0.6.7)
wpasupplicant (>= 0.6.7),
tinc
Description: VyOS configuration scripts and data
VyOS configuration scripts, interface definitions, and everything

Expand Down
Loading

0 comments on commit 195cc7a

Please sign in to comment.