From 00719a5e59f3f84a3b2e7a15e1dcb85066565cc8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Jan 2021 16:40:38 +0100 Subject: [PATCH] [openwrt] add script to create ipv4 islands --- openwrt/openwrt-add-jool-ipv4island.sh | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 openwrt/openwrt-add-jool-ipv4island.sh diff --git a/openwrt/openwrt-add-jool-ipv4island.sh b/openwrt/openwrt-add-jool-ipv4island.sh new file mode 100755 index 0000000..2b38865 --- /dev/null +++ b/openwrt/openwrt-add-jool-ipv4island.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "$0 ip-address nat64-prefix" + echo " ip-address: where to find the OpenWRT device" + echo " nat64-prefix: which network to use for INCOMING NAT64 (often 2a0a:e5c1:XXX:b00::/96" + echo " ip4-address: where to map ipv6 traffic to (often: 192.168.1.42)" + exit 1 +fi + +my_ip=$1; shift +nat64_prefix=$1; shift +v4addr=$1; shift + +cat < /etc/rc.local << EO2 + +modprobe jool + +jool -4 -a ${v4addr} +jool -6 ${nat64_prefix} +EO2 + +sh /etc/rc.local + +EOF