"NAT Port Forwarding" not working for MySQL DB Jail

xale

Dabbler
Joined
Mar 20, 2021
Messages
12
Apologies if this is already a solved issue, as there are a lot of similar threads, but I can't seem to find one that describes exactly the situation I'm in.

I'm running TrueNAS Core 13.0-U5.1

I've got a jail set up for use as library database for my various Kodi machines:

basic.png


The MySQL config is very straightforward:
Code:
[mysqld]
user                            = xxxxx
port                            = 3306
socket                          = /tmp/mysql.sock
bind-address                    = 0.0.0.0

If I understand correctly, I should be able to just configure this setting:

forwardingPNG.PNG


and I should be able to reach the database inside the jail (listening on 3306) from machines on my local network via 8306.

This doesn't seem to be working. I can connect to from inside the jail:
Code:
root@kodidb:~ # telnet localhost 3306
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

...but I can't reach it from outside:
Code:
root@nas[/]# telnet localhost 8306
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host

I recall having done something similar before, but I recently had to reconfigure things after a drive failure, (yeah, yeah, back up my configs...) so I suspect I'm just missing something obvious. Anyone know what it might be?
 

xale

Dabbler
Joined
Mar 20, 2021
Messages
12
Little bump!
 

xale

Dabbler
Joined
Mar 20, 2021
Messages
12
Another quick bump here. I haven't done any further debugging, (mostly because I don't know where to begin) but from what I can tell, this seems like a pretty straightforward case of a feature just... not working as intended.
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
Why change the port?
My kodi setup works fine with 3306.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Why mess with the host firewall and NAT? VNET jails are the best invention since sliced bread.
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
Yup, I did not see the NAT !!!!!
 

xale

Dabbler
Joined
Mar 20, 2021
Messages
12
I suppose using VNET jails is an option, but - and correct me if I'm wrong - wouldn't using VNET require that I reserve IPs on my network for each jail? I'd much prefer to serve everything from a single IP.

(In addition, all my Kodi devices are already configured with the IP/port configuration, because I had used it successfully in the past.)

It also seems to me that this (port forwarding) should be a really straightforward feature, and if I'm using it right, this might be an actual bug?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Yes, one IP per jail. I run all jails like that. Install avahi inside the jail, ssh to <jailname>.local - works great.

About the bug - I never use NAT when I can avoid it. NAT sucks :smile: So ... possibly ...? No idea.
 
Top