#!/bin/sh # 2020-06-13, Nico Schottelius # See https://ungleich.ch/u/products/viirb-ipv6-box/ if [ $# -ne 2 ]; then echo "$0 viirb-ip-address viirb-id" echo " viirb-ip-address: where to find the viirb" echo " viirb-id: number in decimal format" exit 1 fi set -x viirb_ip=$1; shift id=$1; shift hex_id=$(printf "%0.2x\n" "$id") viirb_hostname=viirb${id} prefix_base=2a0a:e5c1:3 my_prefix=${prefix_base}${hex_id} my_network=${my_prefix}::/48 my_wireguard_ip=${my_prefix}::42 my_lan_ip=${my_prefix}:cafe::42 my_wifi_ip=${my_prefix}:7ea::42 # wireguard private_key=$(wg genkey) public_key=$(echo $private_key | wg pubkey) vpn_endpoint_host=vpn-2a0ae5c1300.ungleich.ch vpn_endpoint_pubkey=ft68G2RID7gZ6PXjFCSCOdJ9yspRg+tUw0YrNK9cTxE= cat < ${viirb_hostname}.public_key