diff --git a/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/README.md b/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/README.md index b40657b..de72117 100644 --- a/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/README.md +++ b/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/README.md @@ -231,7 +231,7 @@ $ source ~/.bashrc #### Install cURL and Python ```shell -apt install -y curl python +apt install -y curl python3 ``` #### Generate random IPv6 ULA and save to environment variables @@ -241,8 +241,8 @@ Shout out to [Andrew Ho](https://gist.github.com/andrewlkho/31341da4f5953b8d977a The following command downloads and runs [ulagen.py](./ulagen.py) ([PGP signature](./ulagen.py.sig), [PGP public key](https://sunknudsen.com/sunknudsen.asc)). ```console -$ curl -s https://sunknudsen.com/static/media/privacy-guides/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/ulagen.py | python | grep "First subnet" | awk '{print "STRONGSWAN_IPV6_ULA="$3}' | tee -a ~/.bashrc -STRONGSWAN_IPV6_ULA=fdcb:f7a1:38ec::/64 +$ curl -s https://sunknudsen.com/static/media/privacy-guides/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/ulagen.py | python3 | grep "First subnet" | awk '{print "STRONGSWAN_IPV6_ULA="$3}' | tee -a ~/.bashrc +STRONGSWAN_IPV6_ULA=fdba:8ce0:c301::/64 $ source ~/.bashrc ``` diff --git a/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/ulagen.py b/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/ulagen.py index 166c578..7cd5be1 100755 --- a/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/ulagen.py +++ b/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/ulagen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import hashlib import time @@ -16,13 +16,13 @@ def time_ntpformat(): def main(): h = hashlib.sha1() - h.update(get_eui64() + str(time_ntpformat())) + h.update(str(get_eui64() + str(time_ntpformat())).encode("utf-8")) globalid = h.hexdigest()[0:10] prefix = ":".join(("fd" + globalid[0:2], globalid[2:6], globalid[6:10])) - print "Prefix: " + prefix + "::/48" - print "First subnet: " + prefix + "::/64" - print "Last subnet: " + prefix + ":ffff::/64" + print("Prefix: " + prefix + "::/48") + print("First subnet: " + prefix + "::/64") + print("Last subnet: " + prefix + ":ffff::/64") if __name__ == "__main__": main() diff --git a/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/ulagen.py.sig b/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/ulagen.py.sig index 023cfca..fa4bdca 100644 Binary files a/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/ulagen.py.sig and b/how-to-self-host-hardened-strongswan-ikev2-ipsec-vpn-server-for-ios-and-macos/ulagen.py.sig differ