~lord/krasovs.ky

ref: b112d069bdf00e6f983bc88349aef355a573cae3 krasovs.ky/content/blog/wireguard-allowed-ips.md -rw-r--r-- 1.9 KiB
b112d069Savely Krasovsky fix(telegram-web-apps): title fix 5 months ago

#date: 2021-07-04 title: "Wireguard's AllowedIPs calculator" layout: post

As you possibly know Wireguard hasn't something like "DisallowedIPs" parameter to exclude some networks from allowed ones. Of course technically AllowedIPs is enough, but I am tired to calculate it by hand, so created this simple calculator:

#calculator { display: grid; grid-template-columns: fit-content(0) auto; gap: .5rem } #calculate-button { grid-column: 2; } #use-api-wrapper { grid-column: 2; } #final-allowed-ips { grid-column: 1 / 3; margin-top: .5rem; margin-bottom: 0; } AllowedIPs: DisallowedIPs:
Use API instead of WASM
AllowedIPs =

Update: I am using small Golang HTTP-server to quickly calculate results and at first I tried ipaddr due to its similarity to the Python ipaddress. But it has a little problem, in my case it caused an infinite loop that led to DoS and finally to panic. Better use the brilliant netaddr developed by Brad Fitzpatrick and the Tailscale team (their blogpost with motivation)

Update 2: I realized that this is a great case to use WASM!