Update tinc/tinc-up.tmpl, tinc/tinc.conf.tmpl, tinc/tinc-down.tmpl files

This commit is contained in:
sump pump 2020-06-21 05:01:27 +00:00
parent 7e235ff640
commit 0b421179f6
3 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,7 @@
#!/bin/sh #!/bin/sh
{{ if len "${ip_aliases:-}" }}{{ range "$ip_aliases" | split "," }}iptables -t nat -D PREROUTING -d {{ . }} -i \$INTERFACE -j DNAT --to-destination ${tinc_peer_address}
iptables -t nat -D PREROUTING -d {{ . }} -i ${internal_interface:-eth0} -j DNAT --to-destination ${tinc_peer_address}
{{ end }}{{ end }}
# Disable IPv4 kernel routing/forwarding for this network # Disable IPv4 kernel routing/forwarding for this network
iptables -D FORWARD -o \$INTERFACE -d ${network_address}/${global_prefix:-16} -j ACCEPT iptables -D FORWARD -o \$INTERFACE -d ${network_address}/${global_prefix:-16} -j ACCEPT

View File

@ -1,6 +1,9 @@
#!/bin/sh #!/bin/sh
ifconfig \$INTERFACE ${tinc_peer_address} netmask ${netmask:-255.255.255.0} ifconfig \$INTERFACE ${tinc_peer_address} netmask ${netmask:-255.255.255.0}
{{ if len "${vip:-}" }}ifconfig "\$INTERFACE:0" ${vip}{{ end }} {{ if len "${vip:-}" }}ifconfig "\$INTERFACE:0" ${vip}{{ end }}
{{ if len "${ip_aliases:-}" }}{{ range "$ip_aliases" | split "," }}iptables -t nat -I PREROUTING -d {{ . }} -i \$INTERFACE -j DNAT --to-destination ${tinc_peer_address}
iptables -t nat -I PREROUTING -d {{ . }} -i ${internal_interface:-eth0} -j DNAT --to-destination ${tinc_peer_address}
{{ end }}{{ end }}
# Enable IPv4 kernel routing/forwarding for this network # Enable IPv4 kernel routing/forwarding for this network
iptables -A FORWARD -o \$INTERFACE -d ${network_address}/${global_prefix:-16} -j ACCEPT iptables -A FORWARD -o \$INTERFACE -d ${network_address}/${global_prefix:-16} -j ACCEPT

View File

@ -21,6 +21,7 @@ Port = ${tinc_bind_port:-9994}
DeviceType = ${tinc_device_type:-tap} DeviceType = ${tinc_device_type:-tap}
Device = ${tinc_device:-/dev/net/tun} Device = ${tinc_device:-/dev/net/tun}
Mode = ${tinc_mode:-switch} Mode = ${tinc_mode:-switch}
Forwarding = kernel
AddressFamily = ${tinc_address_family:-ipv4} AddressFamily = ${tinc_address_family:-ipv4}
# Default over-the-wire security for Lixonet. # Default over-the-wire security for Lixonet.