[ "$redirect_proto" == "tcpudp" ] && redirect_proto="tcp udp"
for redirect_proto in $redirect_proto; do
- fw add $mode n $natchain $redirect_target ^ { $redirect_src_ip $redirect_dest_ip } { \
+ local pos
+ eval 'pos=$((++FW__REDIR_COUNT_'${mode#G}'_'$natchain'))'
+
+ fw add $mode n $natchain $redirect_target $pos { $redirect_src_ip $redirect_dest_ip } { \
$srcaddr $srcdaddr \
${redirect_proto:+-p $redirect_proto} \
${srcports:+--sport $srcports} \
fw_get_negation dest_spec '-d' "${rule_dest_ip:+$rule_dest_ip/$rule_dest_ip_prefixlen}"
local rule_pos
- eval 'rule_pos=$((++FW__RULE_COUNT_'$mode'_'$chain'))'
+ eval 'rule_pos=$((++FW__RULE_COUNT_'${mode#G}'_'$chain'))'
[ "$rule_proto" == "tcpudp" ] && rule_proto="tcp udp"
for rule_proto in $rule_proto; do