# load balancing random ports



## frullis (May 12, 2014)

I'm trying figure out if it possible to use IPFW/PF to load-balancing traffic to random ports. *I* would like to have one port that is being open from firewall, IPFW or PF. *F*or example port 5000/udp. all connections that go to this port will be load-balanced via round-robin to port 1194-1197/udp etc.

*I* used somethin*g* simil*a*r with Linux/iptables before.

```
-A PREROUTING -d 11.22.33.44/32 -i eth0 -p udp -m udp --dport 5000 -j REDIRECT --to-ports 1194-1197 --random
```
but *I* haven*'*t found anything good in freebsd FreeBSD to achieve the same. *A*ny suggestion?


----------



## junovitch@ (Jun 13, 2014)

`man pf.conf | less -p round-robin`.  There are some examples tied to that keyword for PF.

*EDIT*. I just noticed you asked a month ago. Sorry this took so long before someone looked at it. I hope this is still useful to you.


----------

