Forum Discussion

JD_Tomzak's avatar
JD_Tomzak
Icon for Cirrus rankCirrus
Nov 14, 2024

VIP needed for many UDP ports

Greetings,

 

I have been asked to create an F5 solution for UDP. There a dozen or so ports, so I was going to make a pool for each (same servers are in all of them, but listening on different ports)

My plan was to make 1 VIP listening on port 0 and have a policy look at the requested UDP port to send to the correct pool. Trouble is, at least in my version of LTM 13.1.5 UDP port match is not an option. TCP is there...

My question , will I be able to do this in a newer version of LTM?

Or will an Irule work for this ? 

Thanks,

 

 

  • Hi JD_Tomzak 

     

    Can u try this with below irule, you can allow all port (configure 0 udp). create a irule and map. dont add any pools in resource. some ports i added as example. you can try it with your ports.(I am not tried this in lab)

     

    when CLIENT_ACCEPTED {
        # Get the destination port of the incoming UDP packet
        set udp_port [UDP::local_port]

        # Select pool based on the destination port of the UDP packet
        switch $udp_port {
            53 {
                pool pool_dns
            }
            123 {
                pool pool_ntp
            }
            514 {
                pool pool_syslog
            }
            1812 {
                pool pool_radius
            }
          
        }
    }

  • Looks like this will work fine. Glad to see UDP is an option in Irule but odd that its not available for policy.

    Thanks for the quick reply!

  • Hi JD_Tomzak 

     

    Can u try this with below irule, you can allow all port (configure 0 udp). create a irule and map. dont add any pools in resource. some ports i added as example. you can try it with your ports.(I am not tried this in lab)

     

    when CLIENT_ACCEPTED {
        # Get the destination port of the incoming UDP packet
        set udp_port [UDP::local_port]

        # Select pool based on the destination port of the UDP packet
        switch $udp_port {
            53 {
                pool pool_dns
            }
            123 {
                pool pool_ntp
            }
            514 {
                pool pool_syslog
            }
            1812 {
                pool pool_radius
            }
          
        }
    }