Re: [exim] option "interface" in smtp transport and ipv6

Inizio della pagina
Delete this message
Reply to this message
Autore: J.R.Haynes
Data:  
To: Marcin Mirosław
CC: exim-users@exim.org
Oggetto: Re: [exim] option "interface" in smtp transport and ipv6
On Thu, 1 Jul 2010 at 20:47 +0100, Marcin Mirosław wrote

>
> Yes, i read it. But i don't speak well english and maybe i can't catch
> nuance.
>


My understanding is that if a domain has both v4 and v6 addresses Exim
first uses the operating system to decide whether to use v6 or v4 (and
Phil has explained how to change this globally). Then it looks at the
interface option for the first address of that type. If it doesn't find
one then interface is ignored and the default OS interface for that type
is used. So in your case having seen an AAAA record for the relevant
domain Exim has already decided to use v6, so an interface entry with
only a v4 address gets ignored.

>> Use something like (untested):
>>    ignore_target_hosts = <; ::
>> on the Router to refuse to use IPv6 addresses.  Or there's
>> dns_ipv4_lookup as a global option, per "13.6 Disabling IPv6".

>
> But i don't want to disable ipv6!:)
> I.E. My domain: host hermes.mejor.pl
> hermes.mejor.pl has address 193.238.12.139
> hermes.mejor.pl has IPv6 address 2001:470:1f0b:84c::2
>
> From other host (on which i setup transport using interafce=1.2.3.4) i'm
> trying to send mail to domain "mejor.pl". I'd like to send mail via ipv4
> (not via ipv6), because there are two links, and link with ipv4 only is
> faster than link with ipv6. So i put domain "mejor.pl" to file
> "domeny_interfejs.txt" and i'm expecting that exim will use address
> (ipv4) taken from file, and sends via ipv4, although ipv6 can be used
> for this domain.


ignore_target_hosts is router specific. However it looks like your router
runs for all domains (and interface is just ignored for domains without
an entry).

You can run two routers, one with (untested)

domains = /etc/exim/domeny_interfejs.txt
interface       = 
${lookup{$domain}lsearch{/etc/exim/domeny_interfejs.txt}{$value}{}}
ignore_target_hosts = <; ::


and one (running later) without these.


but I would have thought you could also use (again untested)
dns_ipv4_lookup = lsearch;/etc/exim/domeny_interfejs.txt

which would tell exim to only lookup v4 addresses for domains in your
file.

This does assume that you will only put v4 addresses in the file.




> For other domain, not mention in file, i'd like exim to use ipv6 if
> domain is capable.



I'm now not certain what is your actual requirement. Is your goal
simply to control whether IPv4 or IPv6 is used? Or do you have multiple
interfaces of each type and therefore you also need to specify which IP
address to use? If you just want a v4/v6 switch then I don't think you
need to use interface at all. Just have a file that lists the domains for
which you want to ignore ipv6 and use

dns_ipv4_lookup = /etc/exim/ipv4_only

Then exim will not do AAAA lookups for these domains and therefore will
only get A records and will use v4. For entries not in the file AAAA
records will be looked up if available and v6 used (assuming your OS
prefers v6 as appears to be the case).

Jonathan

--
------------------------------------------------------------------------------

                              J. R. Haynes
                         Senior Network Specialist


      IT Department,                  e-mail: J.Haynes@???
      Bld 63,
      Cranfield University,           Tel: Bedford (01234) 754205
      Wharley End,                         Bedford (01234) 750111 Extn 4205
      Cranfield,                      Fax: Bedford (01234) 751814
      Beds.,
      MK43 0AL.