Link to home
Start Free TrialLog in
Avatar of mactfines
mactfinesFlag for Afghanistan

asked on

Specify Outbound Network Interface in ODBC Connection

Background:
A client machine needs to be able to query a SQL Server over the network using an ODBC connection.  The server will only accept connections from a specific IP range, and the client machine is not in the range.

We've come up with the idea of adding a second network card to the client machine, and configuring the second network card with an IP address that is in the specific range.  With that done, we now need to make the ODBC connection use that second network interface.  That is, the client needs to be configured to always connect to the SQL server using the second network interface.  Is this possible?  How?

Please note I have read this post already.  That question is the same as mine, but neither of those answers addresses the question.
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

I have dual NICs in several computers here.  Windows uses the one that connects to the IP range I ask for.  I have two networks using private IP address ranges, one in 10.202.xx.xx and the other is 172.23.xx.xx.  On two machines I have web servers with two IP addesses, one in each range, and it works fine.

How is your setup different?  And how are you connecting to the SQL server?
Avatar of mactfines

ASKER

The difference here is that the SQL Server we are connecting to is not in the IP range of either of the network interfaces.  It is actually at another company altogether.  All connections to it need to come from a specific range of addresses, so I need to make the client always tries to connect using the new, second interface.  The logic Windows uses results in it always using the first--which makes sense to me, given they both have the same path through the Internet to the SQL server...

However, now that I write all that out, we should be able to just use the route command to specify that the route to the SQL server's IP always uses the second network interface.
ASKER CERTIFIED SOLUTION
Avatar of kevinhsieh
kevinhsieh
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial