Skip to Content.
Sympa Menu

freetds - Re: [freetds] How to specify the local ip address to connect from

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Steven Peterson <speterson AT listpilot.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] How to specify the local ip address to connect from
  • Date: Tue, 30 Oct 2012 10:13:50 -0400

Peter,

Thanks for your comment on using 'route'. Do you think that using 'route'
would be preferred over 'iptables' as a way to indicate the sending IP in
FreeTDS connections? What are the advantages?

- Steve


> My interim solution will be as you suggest -- use the iptables
> > nat table to change the source IP address based on the port, (I can
> > specify a dummy port in FreeTDS, and use that as a flag to iptables to
> > rewrite the 'from' IP). While this may be the general solution, it is
> > probably getting further into linux than many FreeTDS users are able.
> > So, please consider a bindAddress parameter as a suggestion to make
> > using FreeTDS easier for people who are not so familiar with linux.
>
> FWIW unless you bind to a specific interface the kernel normally selects
> source address based on local knowledge of routing table.
>
> If you add a route preferencing destination OS will pick the right
> source address for you.
>
> For example:
>
> route add -host mysqlserver mysourceinterface
> (route add -host 10.0.0.1 eth1:1)
>
> regards,
> Peter
>




Archive powered by MHonArc 2.6.24.

Top of Page