2

I'm trying to set up a MariaDB 10.2 Server on a FreeBSD 11.2 Jail.

The Server is running and accepts remote connections via IPv4 just fine. According to sockstat, it should also be listening on IPv6:

db# sockstat | grep 3306   
mysql    mysqld     17516 177 tcp46 *:3306                *:*

This is indeed what I was going for, hence my my.cnf:

db# cat my.cnf | grep -vE "^#"
[client]
port������������= 3306
socket����������= /tmp/mysql.sock

[mysqld]
port������������= 3306
bind-address����= ::
socket����������= /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 240K

server-id�������= 1

innodb_buffer_pool_size = 1G
innodb_log_file_size = 256M
innodb_log_buffer_size = 16M

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

However, when I try to connect to it via IPv6, my request times out:

db# telnet db.local 3306            
Trying fd0b:9867:5eb1::3306...
telnet: connect to address fd0b:9867:5eb1::3306: Operation timed out
telnet: Unable to connect to remote host
db# telnet ::1 3306            
Trying ::1...
telnet: connect to address ::1: Operation timed out
telnet: Unable to connect to remote host

Via IPv4, it doesn't:

db# telnet 10.0.0.10 3306
Trying 10.0.0.10...
Connected to db.burnus.net.
Escape character is '^]'.
Y
5.5.5-10.2.22-MariaDB>8vmB=LG)M'zTti5g)3emysql_native_password^CConnection closed by foreign host.                                          
db# telnet 127.0.0.1 3306
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Y
5.5.5-10.2.22-MariaDB?',Jme7}$Wm@70-/FO<~mysql_native_password^CConnection closed by foreign host.

Of course, both addresses are associated with the jail's network interface:

db# ifconfig em0 | grep inet
��������inet 10.0.0.10 netmask 0xffffffff broadcast 10.0.0.10  
��������inet6 fd0b:9867:5eb1::3306 prefixlen 128

There is no firewall in place.

Removing the bind-address in my.cnf or changing it to the correct IPv6 Address or the hostname does not do the trick either. Do you have any idea, what I might be doing wrong?

1

Solved it. Naturaly, it came down to a routing error. Everything stated obove was set up correctly, but the host redirected all traffic on port 3306 to the Jail's IPv4 address, which somehow caused the MariaDB service to not trust it anymore.

  • So, what did you change, FROM and TO on the host to allow success? – Wilson Hauck Mar 29 at 17:11
  • 1
    I disabled NAT for this jail in my pf.conf: > #rdr on $IF_EXT inet proto tcp from any to $IF_EXT port $PORTS_DB -> $IP4_DB – Burnus Mar 31 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.