Forum Discussion
Andy_McGrath
Sep 25, 2018Cumulonimbus
First why are you using
uie
persistence profile if you all you need/want is source address persistence? If you are using source IP then you do not need to make is this complex with uie
and simply use source address.
Second the commands
persist
and session
do different things, persist
is purely for creating, looking up and removing persistent records (core session table records). The session
is used for storing arbitrary/additional information in the session table.
Use
persist
instead of session
for what you are trying to achieve, for example:
when CLIENT_ACCEPTED {
set src_IP [IP::client_addr]
if {[persist lookup uie $src_IP]} {
persist uie $src_IP
log local0. "existing client port [persist lookup uie $src_IP] for client ip $src_IP"
} else {
persist add uie $src_IP 1800
log local0. "added client port [persist lookup uie $src_IP] for client ip $src_IP "
}
}
NOTE: this is just a UIE version of source address persistence and at that more complex than needed as the following does the same:
when CLIENT_ACCEPTED {
persist uie [IP::client_addr] 1800
}