diff --git a/pib-setup.sh b/pib-setup.sh new file mode 100755 index 0000000..b0e4438 --- /dev/null +++ b/pib-setup.sh @@ -0,0 +1,168 @@ +#!/bin/sh + +if [ $# -ne 2 ]; then + echo "$0 ip-address vpn-network" + echo " ip-address: where to find the PIB" + echo " network: 2a0a:e5c0:123::/48" + exit 1 +fi + + + +my_ip=$1; shift +my_network=$1; shift + +my_prefix=$(echo $my_network | sed 's,::/.*,,') +my_hostname=pib-$(echo ${my_prefix} | sed 's/:/-/g') + +my_wireguard_ip=${my_prefix}::42 +my_lan_ip=${my_prefix}:cafe::42 +my_lanv6_ip=${my_prefix}:7ea::42 + +private_key=$(wg genkey) +public_key=$(echo $private_key | wg pubkey) + +vpn_endpoint_host=vpn-2a0ae5c1.ungleich.ch +vpn_endpoint_pubkey=hi60lGP+xEUQ+kVnqA7PlJAO1SVqTS1W36g0LhFP0xQ= + +cat < ${my_hostname}.public_key + +exit 0 + + +# wget -O - https://downloads.openwrt.org/releases/19.07.3/targets/x86/64/openwrt-19.07.3-x86-64-rootfs-ext4.img.gz | gunzip > /dev/sda