It turns out that iptables doesn\'t handle leading zeros too well. As $machinenumber that is used has to have a leading zero in it for other purposes, the idea
$machinenumber
A pure bash solution:
> N=0001023450 > [[ $N =~ "0*(.*)" ]] && N=${BASH_REMATCH[1]} > echo $N 1023450