[openwrt] add script to create ipv4 islands
This commit is contained in:
parent
143917ca86
commit
00719a5e59
1 changed files with 31 additions and 0 deletions
31
openwrt/openwrt-add-jool-ipv4island.sh
Executable file
31
openwrt/openwrt-add-jool-ipv4island.sh
Executable file
|
@ -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 <<EOF | ssh -t "root@${my_ip}"
|
||||
set -x
|
||||
|
||||
opkg update
|
||||
opkg install kmod-jool jool-tools
|
||||
|
||||
cat > /etc/rc.local << EO2
|
||||
|
||||
modprobe jool
|
||||
|
||||
jool -4 -a ${v4addr}
|
||||
jool -6 ${nat64_prefix}
|
||||
EO2
|
||||
|
||||
sh /etc/rc.local
|
||||
|
||||
EOF
|
Loading…
Reference in a new issue