
S1
仮想マシン 1: Ubuntu アプリ サーバー
仮想マシン 2: MariaDB 1
シーズン2
仮想マシン 3: Ubuntu アプリ サーバー
仮想マシン 4: MariaDB 2
vm04と03からはポート3306の接続文字列でDB1に接続できますが、vm01と02からはDB2に接続できません
telnetは3306からDB2に接続できる
両方の DB は MariaDB 10.6 で、すべての VM は同じ構成になっています。VM03 は DB2 に接続できます。
tcpdump を使用して DB2 トラフィックをリッスンすると、リクエストが DB に到着していることはわかりますが、その後に何が起こるかは正確にはわかりません。
何か案が:
netstat -tulpn | grep LISTEN | grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 5145/mariadbd
tcp6 0 0 :::3306 :::* LISTEN 5145/mariadbd
編集:
DB1のエラーメッセージ
2023-02-27 12:32:17 5771 [Warning] Aborted connection 5771 to db: 'testdev' user: 'testuser' host: 'vm02' (Got timeout reading communication packets)
ルート -n (db2)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 PublicIP 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 192.168.1.151 0.0.0.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
s1 192.168.2.0/24
s2 192.168.1.0/24
iptables
iptables -A FORWARD -p tcp --source 192.168.2.1/24 --dport 3306 -j ACCEPT
iptables -A FORWARD -p tcp --source 192.168.2.1/24 --dport 3307 -j ACCEPT
iptables -A INPUT -p tcp --source 192.168.2.1/24 --dport 3306 -j ACCEPT
iptables -A INPUT -p tcp --source 192.168.2.1/24 --dport 3307 -j ACCEPT
same for 1.1./24 subnets