Skip to content

Instantly share code, notes, and snippets.

@iam-TJ
iam-TJ / ipv4-in-ipv6
Last active May 1, 2023 19:23
Easily set up IPv4 in IPv6 tunnel
#!/usr/bin/env sh
usage()
{
cat <<-EOF
usage: ${0} [c[lient] | g[ateway]] [u[p] | d[own]]
Copyright 2023 Tj <hacker@iam.tj>
Licensed on the terms of the GNU General Public Licence version 3.
Create IPv4 in IPv6 tunnel on IPv6-only networks
@iam-TJ
iam-TJ / ipv6-ula-gen
Created January 2, 2021 01:46
Deterministically calculates an IPv6 Unique Local Address (ULA) prefix
#!/usr/bin/env bash
# ipv6-ula-gen
# Copyright January 2021 Tj <hacker@iam.tj>
# Licensed on the terms of the GNU General Public Licence version 3
#
# Deterministically calculates an IPv6 Unique Local Address (ULA) prefix
#
# Useful in test harnesses and reproducible build scenarios, and for repeatedly
# generating/recreating the same prefix at different times. The latter is useful
# in scripts that need to generate complete ULAs for hosts as in the example below.