2 ipranges on eth0

Gerd29

Verified User
Joined
Apr 11, 2006
Messages
17
2 ipranges on eth0 conflict (need help)

Hi all,

im having a problem, i shall explain my current setup first.



Server 1:
This server has iprange 82.94.225.130 till 254
gateway 82.94.225.129
subnet 255.255.255.192

Server 2 (my external mysqlserver)
This server has 2 ipnumbers 82.94.170.194/195
gateway 82.94.170.193
subnet 255.255.255.192

When i add 82.94.170.196 till 254 as extra range on server 1, server 2 mysql becomes unreachable.
Server 1 connects to server 2 with ip 82.94.170.194
I tryed to add a wildcard, but this doesnt work.

i can ping server 2 from server 1 without any problems.

What could cause this?
 
Last edited:
Its seems to use an other default ip on server 1
But when i allow this ip in mysql on server 2 it still doesnt connect


ERROR 1045 (28000): Access denied for user 'xxxxx'@'82.94.170.196' (using password: YES)

this should be 82.94.225.134

Weird when i remove the second range again, it connect like it should true 82.94.225.134
How can i set the default ip it connects from?

i tryed to edit /etc/my.cnf with bind-address=82.94.225.134
but that doesnt work.
 
Last edited:
ERROR 1045 (28000): Access denied for user 'xxxxx'@'82.94.170.196' (using password: YES)

this should be 82.94.225.134
No, it shouldn't.
The given credentials refer to the privilege, not the connecting source: the IP address is the "hostname" field of the xxxxx privilege.
You said that server #1 connects to server #2 (MySQL) using 82.94.170.194 but obviously you or the connecting application are wrong, because it is connecting to 82.94.170.196. You have to change the privilege hostname field to 82.94.170.196 or modify the connecting application to connect to 82.94.170.194 instead.

Weird when i remove the second range again, it connect like it should true 82.94.225.134
How can i set the default ip it connects from?
By default linux uses the first (some say the latest added, I'm not sure about that) IP address of the correct routing interface for the given target.

To select another address, you have to use the "src" route directive in order to modify the default route table entry.

How to do that depends on the distribution, I'm not aware of DirectAdmin being capable of configuring this.

Can anyone from DirectAdmin confirm this? And tell me if this can be integrated one day?
i tryed to edit /etc/my.cnf with bind-address=82.94.225.134
but that doesnt work.
Of course, this is the listening address for MySQL, it must be the local IP address where ALL connections are made: if you use only the UNIX socket for local links and 82.94.170.194 as the connecting address, that's what you have to use. If there are local applications connecting to 127.0.0.1 by TCP, this directive must be disabled and a firewall (like iptables) used instead to block connections to undesired addresses.
 
Back
Top