Quantcast
Channel: Squeezebox : Community : Forums - Logitech Media Server
Viewing all articles
Browse latest Browse all 5300

Advanced networking question about LMS on linux

$
0
0
Hello Everyone, and thank's for all of the work you have done there for so many years.

I'm having issues with the network part of the Squeezebox ecosystem. I have a hard time finding information, so fixing mistake take a while.

Right now, i'm having a hard time having both network redirection of the http, and having working client.
From what i have understood, the port used are 9000 for the webpage, 9090 for the cli, and 3483 for slimproto (i have no idea of what this is exactly but i can guess)
if i let 9000 open, and just do a proxy with apache from tcp/80 to localhost:9000 it work well and my client can connect. But i can't let it that way, and i need to "force" the 9000 port on a dedicated interface.
For that, here are my conf :

/etc/default/logitechmediaserver
Code:

# User to run Logitech Media Server as
SLIMUSER=squeezeboxserver

SLIMOPTIONS="--httpaddr 127.0.0.1 --httpport 8999 --cliaddr 192.168.1.XX --playeraddr 192.168.1.XX --streamaddr 192.168.1.XX"

/etc/apache2/sites-available/lms.conf
Code:

listen 9000

<VirtualHost 172.16.0.100:80 172.16.0.100:9000>
    ServerName lms.gdkprod.com
    ProxyPreserveHost ON
    ProxyRequests OFF
    ProxyPass / hxxp://127.0.0.1:8999/
    ProxyPassReverse / hxxp://127.0.0.1:8999/

    ErrorLog ${APACHE_LOG_DIR}/error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/access.log vhost_combined
</VirtualHost>

I replaced http with hxxp because it's my first post and i wasn't allowed to send link
Iptables-save
Code:

# Generated by iptables-save v1.6.0 on Sat May  5 19:57:29 2018
*filter
:INPUT ACCEPT [18780:16002220]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [18542:17423192]
:f2b-sshd - [0:0]
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A INPUT -i eth0 -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i eth1 -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -i eth1 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 9000 -j ACCEPT
-A f2b-sshd -j RETURN
COMMIT
# Completed on Sat May  5 19:57:29 2018
# Generated by iptables-save v1.6.0 on Sat May  5 19:57:29 2018
*nat
:PREROUTING ACCEPT [149:21437]
:INPUT ACCEPT [910:60493]
:OUTPUT ACCEPT [436:29441]
:POSTROUTING ACCEPT [187:11212]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 443 -j DNAT --to-destination 172.16.0.100
-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 172.16.0.100
-A PREROUTING -i eth1 -p tcp -m tcp --dport 443 -j DNAT --to-destination 172.16.0.101
-A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j DNAT --to-destination 172.16.0.101
-A PREROUTING -i eth0 -p tcp -m tcp --dport 9000 -j DNAT --to-destination 172.16.0.100
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -o eth1 -j MASQUERADE
COMMIT
# Completed on Sat May  5 19:57:29 2018

As you can see, i need to nat port from my interface to a local IP, and then i serve the webpage both on tpc/80 and tcp/9000
This is a requirement of my infrastructure.

Sadly, when i let it like that, i do get the webpage on both port, but none of my client can find the server (i specified the IP). If i remove
Code:

--httpaddr 127.0.0.1
from LMS startup argument, then client can find the server.

Can anyone help me understand where id i messed up ? I thinked it should work since i find this(firstpost, can't use link : awesomeco.de/blog/serving-logitech-media-server-slimserver-squeezeboxserver-over-https) tutorial who also force all traffic from tcp/9000 throught apache.

Thank's everyone for your time !

EDIT : Sorry, i forgot a huge information, my audio client work well, what doesn't work are controler client, like phone app, jivelight, squeezeplay.... they can't find the lms server, where the audio player don't have issue.

Viewing all articles
Browse latest Browse all 5300

Trending Articles