Page 1 of 1

[solved] Could not advertise on any available NIC (No VM)

PostPosted: Sun May 06, 2018 4:01 pm
by Daphazard
Hello,

I'm having a problem with Serviio: My TV (Samsung TV / player (E/F-series)) can't find it. I think the relevant parts of the log are the below, but I've attached the entire file just in case.

  Code:
2018-05-06 16:20:43,052 INFO  [RendererSearchSender] Starting Renderer searcher process
2018-05-06 16:20:43,066 WARN  [RendererSearchSender$RendererSearchWorker] Search for Renderers using interface wlx74da38416dce (wlx74da38416dce) failed: Operation not permitted (sendto failed)
2018-05-06 16:20:43,134 WARN  [DiscoveryAdvertisementNotifier] Could not advertise the device on any available NIC, will try again


I found two other instances of this problem on this forum, but on one of them it was a result of the user running Serviio in a virtual machine and in the other it was because of a firewall. However I don't use a VM and there is no firewall that I know of (ufw is installed but disabled).

Running the ListNic app I saw in another thread produces this result:

  Code:
ip: 10.129.143.126,
name: tun0
display name: tun0
loopback: false
p2p: true
up: true
virtual: false
multicast: true
------------------------------
ip: 192.168.1.79,
name: wlx74da38416dce
display name: wlx74da38416dce
loopback: false
p2p: false
up: true
virtual: false
multicast: true
------------------------------
ip: 127.0.0.1,
name: lo
display name: lo
loopback: true
p2p: false
up: true
virtual: false
multicast: false


(wlx74da38416dce is my wifi interface, which is the only one that connects to anything)

Is there something I'm missing (perhaps some instruction to set Serviio up, or some piece of software)?

Note that I recently reinstalled a new OS over my previous one. Both are based on Ubuntu 16.04. Currently I'm using KDE Neon, formerly Mint 18.3.
Serviio worked in the Mint installation, just a few days ago. That installation was there for more than a year, so it's possible that something was set up before that I've forgotten about.

EDIT: Multicast is enabled on the interface, according to ifconfig.
EDIT 2: Log was not debug, attached a new one that is.

Re: Could not advertise the device on any available NIC (No

PostPosted: Tue May 08, 2018 10:13 am
by DenyAll
Under Serviio Console, Status tab (toward the bottom) can you bind to a specific interface/IP address?

If binding doesn't work try disabling the virtual adaptor (the tun0 adaptor) and see if that helps. You may have to restart your device.

Re: Could not advertise the device on any available NIC (No

PostPosted: Tue May 08, 2018 3:51 pm
by Daphazard
Thanks for your reply.

In the status tab, the only other option than automatic was the one I want anyway (192.168.1.79, wlx74da38416dce). This was already selected, but I tried to de-select it and select it again, saving both times. No change, the log still shows the same output.

The only way I could find to disable tun0 was ifconfig, as it doesn't appear in network manager. I couldn't find out how to make it stick after a reboot, however. Trying serviio again while tun0 was down also made no difference.

Re: Could not advertise the device on any available NIC (No

PostPosted: Tue May 08, 2018 6:20 pm
by zip

Re: Could not advertise the device on any available NIC (No

PostPosted: Tue May 08, 2018 6:51 pm
by Daphazard
I tried the advice from the accepted answer, replacing the port with the one Serviio uses (1900) but it didn't have any effect… I also tried doing the same for the TCP port, just in case, and that didn't do anything either.

Re: Could not advertise the device on any available NIC (No

PostPosted: Thu May 10, 2018 7:31 pm
by Daphazard

In the end, this led me to the solution.

If I run:
  Code:
sudo iptables -F

to flush iptables before starting Serviio, it just works!
The rules from your link don't even seem to be needed. I'm not sure why flushing makes it work.

It's a bit inconvenient (since it requires sudo) but at least Serviio works now.

I used visudo to give myself permission to run the command above without having to enter a password, then added it to the script I use to start/stop serviio, but there may be a better solution.

Re: [solved] Could not advertise on any available NIC (No VM

PostPosted: Fri May 11, 2018 2:05 am
by bolzass
Hi Daphazard!
Probably is working because you have the firewall up and working.
With "iptables -F" you are deleting all the rules and set "accept" as default to all the chains.

So, try this (I asume you are using "ufw", if not do the equivalent):
- Place file "Serviio" (attached) at "/etc/ufw/applications.d/", must be root ("sudo cp /tmp/Serviio /etc/ufw/applications.d/" for instance). This defines ports and so for the services needed.
- Allow all these rules -defined at new file- by running: "sudo ufw allow upnp" and "sudo ufw allow serviio". That will be persistent and you shouldn't do it again (to check "ufw status" or "ufw status verbose" ).

By this way not only you will continue being protected by FW, also only have to do once!

.

Re: [solved] Could not advertise on any available NIC (No VM

PostPosted: Fri May 11, 2018 7:49 am
by Daphazard
Hi,

Thanks for the advice.

However, "sudo ufw status" returns "Status: inactive". I did try to enable it earlier and add rules for serviio to it but that didn't make any difference.

firewalld isn't installed either. I don't know of any other firewalls to check for.

EDIT: After a little more testing, it seems that my VPN service is what's blocking serviio. I don't think I configured it any differently than I had before the reinstall, so I'm not sure why. In any case, I'll look into it.

Re: Could not advertise on any available NIC (No VM)

PostPosted: Fri May 11, 2018 8:27 am
by Daphazard
So, that was interesting.

I enabled ufw (with the serviio rules that were already there) - no fix.
Disconnected and reconnected to VPN - works.
Rebooted (with ufw enabled) - works.

Before the reinstallation, I used to have ufw working as well. I don't know enough about iptables but I'm guessing that with ufw enabled, the ALLOW rules for these ports are added before any rules the VPN adds, and so the latter can't block them. Let me know if that makes sense.

Re: [solved] Could not advertise on any available NIC (No VM

PostPosted: Fri May 11, 2018 5:41 pm
by bolzass
Hi!

You're in the right way;)

Seems that yor VPN is using iptables to protect itself/you for connection (sth that seems normal in a security suite), so it encounters a -let me call in that way- an "iptables environment" and he adapts to it. In other words, it encounters some chains up (these coming from ufw) and it creates his own ones. That explains what is happening; and sounds right for you!!!!!

To test it. "sudo iptables -L" to see what's up (with no VPN, nor ufw, etc... basic chains and/or everything to ACCEPT). Now play running w/ your VPN and watch it again (look differences from the command); w/ VPN OFF and UFW ON (chains again); and then UFW+VPN .... [this just for you to play :geek: ].

Anyway, I suggest you set up UFW with serviio needed rules (the file we talked about) as you would have it working and no workarounds needed at scripts and, more important, you will be more protected!.

.

Re: [solved] Could not advertise on any available NIC (No VM

PostPosted: Fri May 11, 2018 10:09 pm
by Daphazard
bolzass wrote:Anyway, I suggest you set up UFW with serviio needed rules (the file we talked about) as you would have it working and no workarounds needed at scripts and, more important, you will be more protected!

I've already added rules for serviio's ports into ufw, and enabled it. That's what I said above; the ports are open with ufw enabled but not with it disabled.

Would your file do something more than that? It all works fine as it is (no flushing iptables required any longer).

Sorry, I couldn't open your file with the free unrar utility so I have no idea what's in it.

Re: [solved] Could not advertise on any available NIC (No VM

PostPosted: Fri May 11, 2018 10:40 pm
by bolzass
I know!, was only to re-confir mit is a good solution ;) .

Sorry, file was with v5 of rar, will just paste content here:
  Code:
[upnp]
title=UPnP protocol (also used by serviio, etc...). SSDP: 1900/udp, M$ event notification and subscriptions: 2869/tcp,tcp ,Early SSDP: 5000/tcp
description=Discovery Service Protocol
ports=1900,2869/udp|2869,5000/tcp
[serviio]
title=serviio Media Streaming Server [service, Console, Media Browser]
description=Media streaming service
ports=8895,23423,23424,23523,23524/tcp

Place it in "/etc/ufw/applications.d/Serviio" and you can activate it as: "sudo ufw allow upnp" and "sudo ufw allow serviio" once.
What is special is UPnP/DLNA related ports, apart from serviio ones.

Could be interesting also igmp & multicast:
  Code:
sudo ufw allow in proto udp to 224.0.0.0/4
sudo ufw allow in proto udp from 224.0.0.0/4


.

Re: [solved] Could not advertise on any available NIC (No VM

PostPosted: Sat May 12, 2018 9:06 am
by Daphazard
Since it works with no issues, I think I'll leave it as it is for now. Thanks for the advice, though.