Plex addon port usage

  • I have the plex addon in use on Kodi in LibreELEC, and I am able to play media without issue. I have ufw set up on the media server with an "Allow" rule for the Kodi IP:

    Code
    32400/tcp (plexmediaserver) ALLOW IN    x.x.x.x
    3005/tcp (plexmediaserver) ALLOW IN    x.x.x.x
    5353/udp (plexmediaserver) ALLOW IN    x.x.x.x
    8324/tcp (plexmediaserver) ALLOW IN    x.x.x.x
    32410:32414/udp (plexmediaserver) ALLOW IN    x.x.x.x

    However, Kodi seems to be attempting to connect to many other source ports, which get blocked:

    Code
    [UFW BLOCK] IN=eth0 OUT= MAC=[mac address] SRC=x.x.x.x DST=[plex server ip] LEN=52 TOS=0x00 PREC=0x00 TTL=63 ID=48300 DF PROTO=TCP SPT=49004 DPT=32400 WINDOW=501 RES=0x00 ACK FIN URGP=0

    The destination port is what I expect for plex (32400), but the source port is all over the place. Obviously, some traffic is being allowed on the expected port because media playback is OK, but why would these other ports be used and is there a way to restrict the plex addon to expected ports?