Add support for Portforwarding TCP/UDP using socat.

This commit is contained in:
2020-06-03 14:10:27 +02:00
parent 53de5746cf
commit 498b34741c
5 changed files with 249 additions and 1 deletions

View File

@ -503,6 +503,49 @@ udp_out_ports=""
forward_udp_out_ports=""
# =============
# --- Portforwarding
# =============
# - Portforwarding TCP
# -
# - portforward_tcp="<device-in>:<src-ip>:<port-in>:<ip-to-forward>:<port-out>"
# -
# - Multiple declarations (blank separated list) are possible
# -
# - Example:
# - portforward_tcp="${ext_if_1}:83.223.86.95:9997:192.168.52.25:22
# - ${ext_if_1}:${ext_1_ip}:80:83.223.86.98:80
# - ${ext_if_1}:${ext_1_ip}:443:83.223.86.98:443
# - "
# -
# - Note!
# - be careful if you use a variable (e.g. ext_1_ip) that it contains NO SPACES.
# -
# - Blank separated list
# -
portforward_tcp=""
# - Portforwarding UDP
# -
# - portforward_udp="<device-in>:<src-ip>:<udp-port-in>:<ip-to-forward>:<udp-port-out>"
# -
# - Multiple declarations (blank separated list) are possible
# -
# - Example:
# - portforward_udp="
# - ${ext_if_1}:${ext_1_ip}:1194:192.168.52.25:1194
# - ${ext_if_1}:${ext_1_ip}:1195:192.168.53.24:1195
# - "
# -
# - Blank separated list
# -
portforward_udp=""
# -------------
# --- Block IP's / IP-Ranges
# -------------

View File

@ -522,6 +522,50 @@ udp_out_ports=""
forward_udp_out_ports=""
# =============
# --- Portforwarding
# =============
# - Portforwarding TCP
# -
# - portforward_tcp="<device-in>,<src-ip>,<port-in>,<ip-to-forward>,<port-out>"
# -
# - Multiple declarations (blank separated list) are possible
# -
# - Example:
# - portforward_tcp="${ext_if_1},${ext_1_ip},9997,2a01:30:0:13:5054:ff:fe83:dbda,c22
# - ${ext_if_1},${ext_1_ip},80,2a01:30:0:13:211:84ff:feb7:7f9c,80
# - ${ext_if_1},2a01:30:0:13:2d1:2bff:fec1:aed0,80,2a01:30:0:13:211:84ff:feb7:7f9c,80
# - ${ext_if_1},2a01:30:0:13:2d1:2bff:fec1:aed0,443,2a01:30:0:13:211:84ff:feb7:7f9c,443
# - "
# -
# - Note!
# - be careful if you use a variable (e.g. ext_1_ip) that it contains NO SPACES.
# -
# - Blank separated list
# -
portforward_tcp=""
# - Portforwarding UDP
# -
# - portforward_udp="<device-in>,<src-ip>,<udp-port-in>,<ip-to-forward>,<udp-port-out>"
# -
# - Multiple declarations (blank separated list) are possible
# -
# - Example:
# - portforward_udp="
# - ${ext_if_1},${ext_1_ip},1094,,1094
# - ${ext_if_1},${ext_1_ip},1095,,1095
# - "
# -
# - Blank separated list
# -
portforward_udp=""
# -------------
# --- Block IP's / IP-Ranges
# -------------

View File

@ -462,3 +462,19 @@ for _port in $forward_udp_out_ports ; do
done
# ---
# - Portforwrds TCP
# ---
declare -a portforward_tcp_arr
for _str in $portforward_tcp ; do
portforward_tcp_arr+=("$_str")
done
# ---
# - Portforwrds UDP
# ---
declare -a portforward_udp_arr
for _str in $portforward_udp ; do
portforward_udp_arr+=("$_str")
done