Can't connect to MariaDB running in a jail

I have a jail bound to the interface lo1 with the IP address 10.0.0.3. In this jail, I am running mariadb105-server.

in /usr/local/etc/mysql/conf.d/server.cnf I have "bind-address = 10.0.0.3"

I can see the binding with netstat -an:
Code:
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address          Foreign Address        (state)
tcp4       0      0 10.0.0.3.3306          *.*                    LISTEN
tcp4       0      0 10.0.0.3.22            *.*                    LISTEN

However, when I try to connect to mysql, it times out:
Code:
root@host:/var/log/mysql # mysql -h 10.0.0.3
ERROR 2002 (HY000): Can't connect to MySQL server on '10.0.0.3' (36)

Similarly, I have a Java application that connects to MySQL. I have tried connecting to "10.0.0.3" and it also times out.

It seems to be something specific to MySQL. If I run:
Code:
ssh 10.0.0.3
It manages to establish connectivity to the locally running SSH just fine (and I checked it was the Jail's SSHD, in case the connection was somehow reaching the host instead).

Does anybody have any ideas as to what could be causing these time-outs? I remember having something like this with MySQL in a jail, but it's been several years sadly!
 
I have managed to resolve this issue.

The issue was related to my PF firewall on the host.

I didn't have
Code:
set skip on lo1
configured, so it was filtering the traffic.

Connecting via 10.0.0.3 now works:

Code:
root@host:~ # mysql -h 10.0.0.3
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 10.5.13-MariaDB FreeBSD Ports
 
Back
Top