#!/bin/bash

rm -f /tmp/batch.nft
create_loop() {
	for ((i=0;i<10000;i++))
	do
		nft "add chain inet osmo-upf tunmap-pre-$i;
add rule inet osmo-upf tunmap-pre-$i ip daddr set 3.3.3.3 meta mark set $i counter accept;
add chain inet osmo-upf tunmap-post-$i;
add rule inet osmo-upf tunmap-post-$i ip saddr set 2.2.2.3 @th,32,32 set 0x302 counter accept;
add element inet osmo-upf tunmap-pre { 2.2.2.3 . 0x$i : jump tunmap-pre-$i };
add element inet osmo-upf tunmap-post { $i : jump tunmap-post-$i };"
	done
}
time create_loop
