Forum Discussion
Andy_McGrath
Oct 20, 2015Cumulonimbus
Need to check the local TCP/UDP port and also logic is reversed as doing multiple 'not equal to' statements, try the following iRule:
when CLIENT_ACCEPTED {
Check if requested port is allowing only TCP 443, TCP 80, UDP 4500 and UDP 500
if { ( [TCP::local_port] != 443 and [TCP::local_port] != 80 and [UDP::local_port] != 500 and [TCP::local_port] != 4500 ) } {
reject
}
}
Only thing not sure about is having the TCP:client_port and UDP::client_port within the same if statement would work, might need to test if the connection is a TCP or UDP connection first.