Skip to content

Commit

Permalink
fix(): tcp support (#31)
Browse files Browse the repository at this point in the history
* fix(): tcp support

Signed-off-by: Md Imran <imranaec@outlook.com>

* fix(): file update done

Signed-off-by: Md Imran <imranaec@outlook.com>

---------

Signed-off-by: Md Imran <imranaec@outlook.com>
  • Loading branch information
narmidm authored Oct 31, 2023
1 parent bab11d7 commit f96480a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions ovpn/scripts/process.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function substituteTemplateParameters() {
sed -i "s;<vpn-network>;${VPN_NETWORK};g" ${VPN_FQDN}/$file
sed -i "s;<vpn-mask>;${VPN_MASK};g" ${VPN_FQDN}/$file
sed -i "s;<vpn-cipher>;${VPN_CIPHER};g" ${VPN_FQDN}/$file
sed -i "s;<gateway-protocol>;${GATEWAY_PROTOCOL};g" ${VPN_FQDN}/$file
done
popd
log "All parameters were substituted."
Expand Down
10 changes: 10 additions & 0 deletions ovpn/scripts/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ function validateIndividualCertRequest() {
FAIL=YES
fi

if [[ -z ${GATEWAY_PROTOCOL} ]]; then
GATEWAY_PROTOCOL="udp"
else
GATEWAY_PROTOCOL=$(echo "${GATEWAY_PROTOCOL}" | tr '[:upper:]' '[:lower:]')
if [[ ${GATEWAY_PROTOCOL} != "udp" && ${GATEWAY_PROTOCOL} != "tcp" ]]; then
GATEWAY_PROTOCOL="udp"
fi
fi


if [[ "${FAIL}" == "YES" ]]; then
log "One or more required parameters were missing."
finish
Expand Down
1 change: 1 addition & 0 deletions ovpn/template/client-openvpn-combined.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ tls-auth ta.key 1
cipher <vpn-cipher>
auth SHA256
tun-mtu 1300
proto <gateway-protocol>

<key>
<client-key>
Expand Down
2 changes: 1 addition & 1 deletion ovpn/template/server-openvpn.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keepalive 10 60
persist-key
persist-tun

proto udp
proto <gateway-protocol>
txqueuelen 5000
tun-mtu 1300

Expand Down

0 comments on commit f96480a

Please sign in to comment.