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 Dec 17, 2022
1 parent 8baca28 commit 577bbc5
Show file tree
Hide file tree
Showing 11 changed files with 991 additions and 1 deletion.
1 change: 1 addition & 0 deletions data/configd-include.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"interfaces-pppoe.py",
"interfaces-pseudo-ethernet.py",
"interfaces-sstpc.py",
"interfaces-tinc.py",
"interfaces-tunnel.py",
"interfaces-vti.py",
"interfaces-vxlan.py",
Expand Down
7 changes: 7 additions & 0 deletions data/templates/tinc/hosts_config.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% for prefix in subnets %}
Subnet = {{ prefix }}
{% endfor %}
{% for addr in local_address %}
Address = {{ addr }}
{% endfor %}
Port = {{ port }}
111 changes: 111 additions & 0 deletions data/templates/tinc/tinc.conf.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
Name = {{ node_name }}
Interface = {{ ifname }}
{% if bridge %}
Mode = {{ bridge }}
{% else %}
Mode = router
{% endif %}
Compression = {{ compression_level }}
Cipher = {{ encryption.cipher }}
Digest = {{ encryption.digset }}
{% if resolve_hostname %}
Hostnames = yes
{% else %}
Hostnames = no
{% endif %}
PrivateKeyFile = {{ private_keyfile }}
Broadcast = {{ broadcast_type }}
{% if disable_resolve_hostname %}
DecrementTTL = no
{% else %}
DecrementTTL = yes
{% endif %}
{% if direct_only %}
DirectOnly = yes
{% else %}
DirectOnly = no
{% endif %}
Forwarding = {{ forwarding_option }}
{% if iff_One_Queue %}
IffOneQueue = yes
{% else %}
IffOneQueue = no
{% endif %}
KeyExpire = {{ key_expire }}
{% if local_discovery %}
LocalDiscovery = yes
{% else %}
LocalDiscovery = no
{% endif %}
MACExpire = {{ mac_expire}}
MaxTimeout = {{ max_timeout }}
PingInterval = {{ ping_interval }}
PingTimeout = {{ ping_timeout }}
{% if priority_inheritance %}
PriorityInheritance = yes
{% else %}
PriorityInheritance = no
{% endif %}
ProcessPriority = {{ priority }}
ReplayWindow = {{ replay_window }}
{% if strict_subnets %}
StrictSubnets = yes
{% else %}
StrictSubnets = no
{% endif %}
{% if tunnel_server %}
TunnelServer = yes
{% else %}
TunnelServer = no
{% endif %}
{% if clamp_mss %}
ClampMSS = yes
{% else %}
ClampMSS = no
{% endif %}
{% if indirect_data %}
IndirectData = yes
{% else %}
IndirectData = no
{% endif %}
MACLength = {{ mac_length }}
PMTU = {{ mtu }}
{% if disable_PMTU_Discovery %}
PMTUDiscovery = no
{% else %}
PMTUDiscovery = yes
{% endif %}
{% if TCP_Only %}
TCPonly = yes
{% else %}
TCPonly = no
{% endif %}
{% 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 %}
{% for conn in connect %}
ConnectTo = {{ conn }}
{% endfor %}
{% if bind_address %}
BindToAddress = {{ bind_address }}
{% endif %}
{% if bind_interface %}
BindToInterface = {{ bind_interface }}
{% endif %}
{% if graph_dump_file %}
GraphDumpFile = {{ graph_dump_file }}
{% endif %}
4 changes: 3 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ Depends:
wireless-regdb,
wpasupplicant (>= 0.6.7),
ndppd,
miniupnpd-nftables
miniupnpd-nftables,
wpasupplicant (>= 0.6.7),
tinc
Description: VyOS configuration scripts and data
VyOS configuration scripts, interface definitions, and everything

Expand Down

0 comments on commit 577bbc5

Please sign in to comment.