From 7a2dd540aa06ac93321153e8f6946e1561027e98 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 27 Apr 2021 12:00:16 +0200 Subject: [PATCH] ++script for creating ipv4 vpn --- openwrt/openwrt-add-ipv4-vpn.sh | 70 +++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100755 openwrt/openwrt-add-ipv4-vpn.sh diff --git a/openwrt/openwrt-add-ipv4-vpn.sh b/openwrt/openwrt-add-ipv4-vpn.sh new file mode 100755 index 0000000..9a824e3 --- /dev/null +++ b/openwrt/openwrt-add-ipv4-vpn.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# 2021-04-27 + + +if [ $# -lt 2 ]; then + echo "$0 host ipv4-address interface [private-key]" + echo " host: where to find the OpenWRT device" + echo " ipv4-address: which ipv4 address to use" + echo " private-key: Use this wireguard key instead of generating one" + exit 1 +fi + +my_ip=$1; shift +my_wireguard_ip=$1; shift + +interface=ungleichipv4 +vpn_endpoint_host=vpn-18515529.ungleich.ch + +if [ $# -eq 1 ]; then + private_key=$1; shift +else + private_key=$(wg genkey) +fi +public_key=$(echo $private_key | wg pubkey) + +vpn_endpoint_host=vpn-18515529.ungleich.ch +vpn_endpoint_pubkey=6BRnQ+dmeFzVCH9RbM1pbJ7u3y3qrl+zUzzYCmC88kE= + + +cat <