openwrt/nat64: add jool support

This commit is contained in:
Nico Schottelius 2024-07-24 11:05:28 +02:00
parent eff8ec227c
commit 9fd12ac43b

View file

@ -9,7 +9,7 @@
# - do not provide IPv4 or IPv6 dhcp/ra on any interface
if [ $# -lt 4 ] ; then
echo $0 "address hostname nat64prefix nat64route asn routerid iBGPpeer1 [iBGPpeer2...]"
echo $0 "address hostname nat64prefix nat64route ipv4out asn routerid iBGPpeer1 [iBGPpeer2...]"
exit 1
fi
@ -17,6 +17,7 @@ address=$1; shift
hostname=$1; shift
nat64prefix=$1; shift
nat64route=$1; shift
ipv4out=$1; shift
asn=$1; shift
routerid=$1; shift
ibgp_peers="$@"
@ -66,11 +67,43 @@ BBB
done
# TODO: configure jool
# TODO: start jool
cat >> /etc/jool/jool-nat64.conf.json <<BBB
{
"comment": "NAT64 by cdist",
"instance": "default",
"framework": "netfilter",
"global": {
"comment": "pool6 prefix",
"pool6": "${nat64prefix}"
},
"comment": "IPv4 pool4 table",
"pool4": [
{
"protocol": "TCP",
"prefix": "${ipv4out}",
"port range": "40001-65535"
}, {
"protocol": "UDP",
"prefix": "${ipv4out}",
"port range": "40001-65535"
}, {
"protocol": "ICMP",
"prefix": "${ipv4out}",
"port range": "40001-65535"
}
]
}
BBB
# start jool
/etc/init.d/jool restart
# TODO: ensure jool is started at boot
# TODO: ensure bird is started at boot
uci commit
/etc/init.d/bird restart