Forum Discussion
What_Lies_Bene1
May 22, 2014Cirrostratus
OK, so can you try using this, I've just adjusted the spacing to make things clearer and added appropriate logging, plus a final else to catch any cases that don't match your test expressions;
switch [IP::client_addr] {
192.168.100.1 { if ([TCP::local_port] >= 5566) && ([TCP::local_port] <= 5580) } {
node 172.16.100.1
snat 10.0.0.10
log local0. "Client 192.168.100.1 used a port between 5566 and 5580"
} elseif { [TCP::local_port] == 4412 } {
node 172.16.200.20
snat 10.0.0.10
log local0. "Client 192.168.100.1 used port 4412"
} elseif { [TCP::local_port] == 5000 } {
node 172.16.100.5
snat 10.0.0.10
log local0. "Client 192.168.100.1 used port 5000"
} else {
log local0. "Client 192.168.100.1 didn't use a port we tested for"
}
}