Media streaming is enabled on my Ubuntu 24:10 PC, but my PC doesn’t appear on the media player in my smart LG TV.
It seems to be a firewall problem, as, when I switch off the firewall every thing works OK.
Do I need to open ports on the firewall? If so, which ones?
Please give a bit more info:
-how is the Ubuntu and TV connected? Wired/wlan on same home network OR are you trying to connect to your home IP from another network?
-UFW as firewall? can you take a screenshot of the rules you have.
-can your PC see your TV? TV sees your PC?
PC and TV connected wirelessly on same home network.
UFW as firewall - yes.
TV sees PC only when firewall is disabled.
Not sure how to tell if PC sees TV.
I have tried opening ports 1900 and 1935 without success.
Hpoe this helps.
Thanks! I searched for help and found this: How to Stream from Linux to Your TV
Check the last one. Can you get it working? With our without ufw? Sorry but Ubuntu with gnome is not my preferred combo. I use HDMI from my PC to my TV so I only neet to choose the input from TV. Chromecast is also cheap option.
Anyone using ufw, could you please check if there’s anything to change. It looks just defaults for me
Thanks for your help.
I have the streaming options set up on Ubuntu and it works fine - but only with UFW disabled.
As soon as I switch on UFW my PC disappears from the list of options.
I think that this definitely indicates that UFW is causing the problem.
Ok, great. Now it’s only ufw issue. Sorry I only use it with default settings if I use it. You should learn which port you should open inside your local network.
I put your problem description into Copilot. The response is below. Hopefully it helps.
It sounds like your firewall is indeed blocking the necessary ports for media streaming. To resolve this, you can open the following ports on your firewall:
- Port 1900 (UDP): This is used for UPnP (Universal Plug and Play) discovery.
- Port 50001 (TCP/UDP): This is used for content browsing.
- Port 50002 (TCP/UDP): This is used for content streaming.
You can open these ports using the ufw
(Uncomplicated Firewall) command on your Ubuntu PC. Here’s how you can do it:
- Open a terminal.
- Run the following commands to open the necessary ports:
sudo ufw allow 1900/udp
sudo ufw allow 50001/tcp
sudo ufw allow 50001/udp
sudo ufw allow 50002/tcp
sudo ufw allow 50002/udp
- Reload the firewall to apply the changes:
sudo ufw reload
After opening these ports, your PC should appear on the media player in your smart LG TV. If you encounter any issues, feel free to ask for further assistance!
Thanks for the response. It seems very logical. Unfortunately, I’m still having problems. Firewall turned off and my computer appears on the media player on TV. Firewall on and my computer disappears. Another PC (Windows) is visible. Here are a couple of screenshots - one of the firewall rules and one of the media sharing screen on Ubuntu.
I’d be pleased to hear any further thoughts.
I wonder is your TV using some protocol other than TCP/UDP?
Can check the TV specifications?
You could check if it really is a port issue by telling ufw to allow all ports (temporarily)
Is your ufw managing more than one network? Make sure you are opening ports on the right network. Sounds silly, but it is easy to make these sort of mistakes.
On my homeserver (having also miniDLNA) seems it listens on the 8200 port too.
Maybe open that port on your computer additionally?
The firewall is working that I understand and dont doubt, but why not just leave it off ?
I know what firewalls do, why we have them etc… but I only switch it on if I have a client paranoid over security. First experiance of it blocking anything.