Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

When running a command like:

mysql -u mysql -h sql.remoteaddress.com

mysql is connecting using the eth0 interface. How do I ask it to use the eth1 interface which has a different IP address than eth0.

Thanks.

share|improve this question

migrated from stackoverflow.com Dec 14 '09 at 7:03

This question came from our site for professional and enthusiast programmers.

    
You'll like my related question: serverfault.com/questions/93740/… –  kolypto Dec 15 '09 at 0:44

1 Answer 1

up vote 4 down vote accepted

Set a routing rule so that connections going to the network where sql.remoteaddress.com resides goes through eth1 rather than the default at eth0.

Try "route --help" to see the description of how to add a route. You'll likely need root/admin access to set up the routing rule.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.