You can test how to get the last octet of the destination IP with something like this:
when RULE_INIT {
set ::translated_ip_prefix "1.2.3."
set destination_ip 10.20.30.40
set last_octet [getfield $destination_ip "." 4]
set translated_ip $::translated_ip_prefix$last_octet
log local0. "\$translated_ip: $translated_ip"
}
(logs: $translated_ip: 1.2.3.40)
You could then use a rule like this on a fastL4 network VIP:
when RULE_INIT {
set ::translated_ip_prefix "10.20.30."
}
when CLIENT_ACCEPTED {
node $::translated_ip_prefix[getfield [IP::local_addr] "." 4] [TCP::local_port]
log local0. "Translated IP: $::translated_ip_prefix[getfield [IP::local_addr] "." 4] [TCP::local_port]"
}
I didn't test this, but it passed a syntax check.
Aaron