connecting to backend from remote ip [solved]

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
glenb
Junior
Posts: 29
Joined: Sun Nov 17, 2019 7:48 am
United States of America

connecting to backend from remote ip [solved]

Post by glenb »

i was hoping to connect to my backend while away from home with my nvidia shield.

i have no issues connecting with multiple frontends on my home network. i use arch linux and mariadb. mariadb bind-address has been at 0.0.0.0
i've opened up port forwards on 3306, 6544, 6543 in my router running openwrt forwarding to backend machine.

i can connect to mysql from the remote location as mythtv with this command: mysql -u mythtv -h 'xxx.xxx.xxx.xxx' -p (where xxx is my hone ip).

the error i see from the backend is: 'Check Subnet Repeat denied connection from ip address: 162.210.202.235'

i am trying to use myth leanback or android mythtv frontend.

i have granted privleges on mythconverg to mythtv user from any incoming using wildcard '%'

it seems like the db part is ok since i can connect via command line using mythtv user fron remote location.

i have no access here to mythtv-setup, but have mythweb where i can change settings, i believe.

any ideas would be appreciated. thanks.
Last edited by glenb on Wed Jul 15, 2020 8:05 pm, edited 1 time in total.
User avatar
bill6502
Developer
Posts: 2299
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: connecting to backend from remote ip

Post by bill6502 »

The setting AllowConnFromAll=1 would be the 1st place I'd check.

Users reading this thread (that can use mythtv-setup) will note that
this is NOT recommended. But is designed exactly for this case. It
also recommends secure IPv4 and IPv6 firewalls.
glenb
Junior
Posts: 29
Joined: Sun Nov 17, 2019 7:48 am
United States of America

Re: connecting to backend from remote ip

Post by glenb »

Thanks for reply, that setting is set to '1'. i also tried to temporarily disable the firewall in the machine running backend. but that did not change anything. i am able to connect to mysql as user mythtv from terminal from remote location. so i am thinking it has something to do with firewall in router. i run tvheadend and i can access and use that from remote location with same firewall port forward for those 2 ports.
User avatar
bill6502
Developer
Posts: 2299
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: connecting to backend from remote ip

Post by bill6502 »

That Warning message (I would have expected CheckSubnet (no space)) shouldn't fire
if the setting is 1. Is it possible it was changed without clearing the settings cache?

mythutil --clearcache can be done remotely. Or simply restarting the BE works.
glenb
Junior
Posts: 29
Joined: Sun Nov 17, 2019 7:48 am
United States of America

Re: connecting to backend from remote ip

Post by glenb »

bill, you are indeed right. under mythweb i had a host with an ip number and one with the hostname. the one with the hostname was not set to one and that made it work. thanks. oddly, not really related, i get buffering from my home in leanback, but on kodi pvr addon, it does not buffer using same files. Thanks very much i am marking thread solved.
0n3man
Newcomer
Posts: 3
Joined: Mon Aug 02, 2021 4:37 am
United States of America

Re: connecting to backend from remote ip [solved]

Post by 0n3man »

I've used mythtv leanfront on a fire stick to access my backend. This app uses port 6544 to access the backend content. All is good when the fire stick is on the same subnet. When I try to use the fire stick in my office which is on a separate network lan segment behind NAT I get the following error in the backend log file:

Aug 1 22:31:53 myth-backend mythbackend: mythbackend[42590]: W HttpServer68 mythcorecontext.cpp:1277 (CheckSubnet) MythCoreContext::CheckSubnet(): Repeat denied connection from ip address: 10.1.2.14

As suggested in this chain I enabled AllowConnFromAll via mythtv-setup and I continue to get this error after the backend restarts. Looking at the software it appears if AllConnFromAll is set then I shouldn't get this error. I tried running "mythutil --clearcache" and it didn't help. Any suggestion on what could be the issue?
User avatar
bill6502
Developer
Posts: 2299
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: connecting to backend from remote ip [solved]

Post by bill6502 »

Also, check: Listen on All IP Addresses = Allow this backend to receive connections on any IP Address assigned to it.
Recommended for most users for ease and reliability. I'd turn AllowConnFromAll off, unless you connect to your BE
from outside of your LAN.
0n3man
Newcomer
Posts: 3
Joined: Mon Aug 02, 2021 4:37 am
United States of America

Re: connecting to backend from remote ip [solved]

Post by 0n3man »

Listen on All IP Addresses is enabled. the mythtv leanfront iis on 192.168.0.0/24 and then gets NAT 10 a 10.1.2.14 address. The backend is on 192.168.1.0/24 network. Connection to port 6544 is rejected giving the HttpServer denied error. It seems like the AllConnFromAll parameter isn't being processed. Any chance you might know where this parameter resides in the database as I was expecting it to be under setting and it wasn't?
User avatar
bill6502
Developer
Posts: 2299
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: connecting to backend from remote ip [solved]

Post by bill6502 »

Code: Select all

mysql --user=mythtv --password mythconverg --execute="SELECT * FROM settings WHERE value='AllowConnFromAll'"
Expect the hostname column to match your BE. Use this to verify:

Code: Select all

curl --header "Accept:Application/JSON" localhost:6544/Myth/GetHostName
0n3man
Newcomer
Posts: 3
Joined: Mon Aug 02, 2021 4:37 am
United States of America

Re: connecting to backend from remote ip [solved]

Post by 0n3man »

Turns out I had two records for "AllowConnFromAll". When I used the setup-mythtv command to set the value it was updating the record that wasn't associated with my current backend. When I set field value in records via SQL it started working. I'm guessing setup-mythtv pulls the name from the ~/.mythtv/config.xml file, I'm not sure how the backend actually gets the backend name. Thanks for the input.
Post Reply