Re: How to specify the local ip address to connect from
Steven Peterson <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CAKGm+6FoQiqoUyye-oX6oe9qDEoa168sY=ZuCLR8+Wr6QkLbog@mail.gmail.com> |
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 >