I read a bit around and it seemst tha dlna uses port 1900 udp but madsonic open ports of dlna servicer randomly at every startup.
I Tried to poen ports 1900/UDP and 2869/TCP but without luck…
Edit: in another hand, if the port is really random, it will complicate the work…the only manner is to implement upnp in shorewall and it is a hole in the wall.
I think that UPNP is another way to say “please dig an large and uncontrolled hole into my rules”.
Sometimes i find appliances with this setting enabled as default. And i switch this immediately off.
My installation is on a VM (Nethserver NG 7.3) inside a Nethserver NG 6.9 configured as server only (no gateway/firewall).
My routers have PnP disabled and forward only the strictly necessary ports (remapped on non standard ports).
I would like serve Madsonic DLNA only in my home lan network so I think I can disable shorewall safely, but I would like to have a configuration with shorewall up…
@stephdl: Topics about uPnP/DLA seem bit taboo on madsonic forum:
Just a google search, these are on the first page. Never disable the firewall, thats half the point of Nethserver. If you dont want a firewall, use freenas and madsonic/subsonic plugin or even run a docker server. I have no problem accessing my madsonic when I portforward to the host “madsonic”. Try opening up just the port you need for madsonic and see if that works.
I think we have to wait…
Played around with madsonic and without “shorewall clear” I could not reach my music files.
Opened all ports I found by netstatting and even if port 4040 tcp or 1900(DLNA) udp was open it still didn’t work.
Word!
What about alternatives (ampache, ushare, mediatomb…etc)?
I can’t wait… The goal is to open the right random port so I used netstat to find out, which ports are open for madsonic: [root@server ~]# netstat -tlpn | grep 4040 tcp6 0 0 :::4040 :::* LISTEN 5267/java [root@server ~]# netstat -tlpn | grep 5267 tcp6 0 0 :::4040 :::* LISTEN 5267/java tcp6 0 0 192.168.1.11:39277 :::* LISTEN 5267/java tcp6 0 0 :::37153 :::* LISTEN 5267/java tcp6 0 0 :::9412 :::* LISTEN 5267/java
The port 39277, the only one which is bound to an IP is the needed one, but the problem is:
So I tried to script it. The following commands worked on 2 of my Nethservers: config set madsonic service MaxMemory 512 Name madsonic TCPPorts 4040,$(echo $(netstat -tlpn | grep $(netstat -tlpn | grep 4040 | cut -c 80-84 | awk '{$1=$1};1') | cut -d "." -f 4 | cut -d ":" -f 2)) UDPPort 1900 access green status enabled webaccess private signal-event firewall-adjust
My thoughts:
Madsonic is a java process, there may be more, so I get the correct madsonic PID out of netstat when searching for 4040.
With the PID I grep the lines, to have the open madsonic ports and echo puts them in one line.
Then I cut the 4th field with point as delimiter, which is the last number of the ip inclusive “:” and port. So just cut it with “:” and the second field is the port to open…
If it fails just run the next 2 lines to get back to the default settings for madsonic service: config set madsonic service MaxMemory 512 Name madsonic TCPPort 4040 access green status enabled webaccess private signal-event firewall-adjust
When you start/restart madsonic your have to wait about 10 seconds, until madsonic fully comes up before you can run the command.
Worked with my LG TV and with VLC on Android…