iptables not allowing mysql connections to aliased ips?
Solution 1:
Do the .184 or .196 hosts client hosts also have additional IP addresses in your the other subnet?
If you do a tcpdump -qn port 3306
and attempt and connect from one of those systems what do you see? Do you see the source address you expect? This is probably a simple routing issue.
When a system is making the route decision, it consults the route table. Route tables are a list that is always consulted in a specific order. The link routes for local networks are almost always the most preferred routes, and will be used before a route that uses a gateway(router). The default gateway is always the route that is used when no other route will applies. If a route a given route has a src
defined, then that address will be preferred and most likely used when that route is being used.
10.2.13.0/24 dev eth1 proto kernel scope link src 10.2.13.1
10.2.4.0/23 dev eth0 proto kernel scope link src 10.2.4.245
default via 10.2.4.1 dev eth0
So given this example route table for a multi-homed system, anything destined for 10.2.13.0/24
will come from 10.2.13.1
, and anything destined for 10.2.4.0/23
will come from 10.2.4.245
.