The MariaDB user specifies an allowed IP address in the Host
column of the mysql.user
table. So, it only allows logging in from the host with the specified IP address. And MySQL has the same design.
We have verified in testing:
With VirtualBox hypervisor, a virtual machine runs on the allowed host, and the VM's Setting has a "NAT" network adaptor for global traffics. So, the MariaDB user account also allows logging in from the VM.
Our Questions:
- Why does the allowed host IP address of MariaDB user also allow the VM running on the host?
On both the host and the virtual machine, the testing connection client is DBeaver with MariaDB JDBC driver. And we want to better understand the mechanism:
- How does the MariaDB server get the source IP address of the in-coming login request? Is it a JDBC driver property, or is it from the TCP/IP protocol?
We highly appreciate any hints and suggestions, or any directions on the terminologies to search.
Notes:
I'm setting a "vmware" tag to this question, as "virtualbox" is not available in the choices.
mysql.user.host
is not the host where the client is running, this is a host detectd by MySQL. If the client accesses MySQL through NAT then MySQL detects NAT address.