Hi, i need help configuring firewalld/iptables on my CentOS 7 VM (VirtualBox).
I have 3 CentOS VM's.
A: 10.0.30.5 (Postfix,Dovecot)
B: 10.0.40.5 (MariaDB, DHCP)
C: 10.0.50.50 (NAT net virtual box) 10.0.30.30 (gateway to 30.0 network), 10.0.40.40 (gateway to 40.0 network).
I have CentOS 7 as router, with iptables to allow NAT from two private networks (Host Only on VirtualBox), and i have access to internet from both private networks.
I can do ping from 10.0.30.X to 10.0.40.x hosts.
I have the next problem:
I have installed postfix,dovecot and MariaDB on host 10.0.30.5 and all works fine.
I can't connnec to MySQL from network 40.0 to 30.0, but i can connect from a client on my real machine (Windows), but because it uses 30.1 gateway (Virtualbox), and it's on the some network...
If i try to connect using:
mysql -u "user" -h "10.0.30.5" -p
From 10.0.40.5 machine (postfix,dovecot...), i have an error (113) can't connect.
If i stop the firewalld service, i can connect fine from 40.0 network to 30.0 network.
How can i say the router i want allow mysql client command to connect to 10.0.40.5 in the other side?
I have a idea how to do it using iptables, but i am using firewalld as default.
Need i create a rule on Router to allow the connection? Can someone tell me the rule? I need fix this today..
All is working fine between networks if i disable firewalld on CentOs 7 router VM.
This is a idea of my config in Router:
3 Network Devices (Ethernet):
A: Custom NAT network (Vbox) 10.0.50.50
B: Custom Host Only network (Vbox) 10.0.40.0
C: Custom Host Only network (Vbox) 10.0.40.0
VBox uses x.1 as gateway on each virtual ethernet/network.
My Router ethernet config is:
A:
ip 10.0.50.50
mask 255.255.255.0
gateway 10.0.50.1
DNS 8.8.8.8
B:
ip 10.0.30.30
mask 255.255.255.0
gateway 10.0.50.1
DNS 8.8.8.8
C:
ip 10.0.40.30
mask 255.255.255.0
gateway 10.0.50.1
DNS 8.8.8.8
All network divices points to 50.1 to access internet (NAT), i think it's ok, but i guess my problem is because this gateway...
I guess i need a rule to redirect/forward 3306 traffic from 40.5 mysql client to 30.5 server (MariaDB).
A rule when traffic come from 40.5 to 30.5 ..right?
Can someone help me?
Thanks and sorry for my english,i am spanish.
If you need more info tell me please, i have to finish this today, and i know it's Router firewalld problem but i have not many time to fix iptables/firewalld rules..Thank you all