Re [Exim] multiple ip address (re)routing

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Iain Price
Date:  
À: exim-users
Sujet: Re [Exim] multiple ip address (re)routing
Cami wrote:
> | If you want Exim to send OUTGOING emails via two different interfaces,
> | you might need to set up two instances of Exim, each associated with an
> | appropriate IP interface. I could be wrong; perhaps there is a clever
> | way to use a router to do it. I can't help you here.
>
> hrmph.. surely someone must of wanted this done before? if for example
> i want ALL mail to come in through one interface, and all out another,
> telling me exim is not able to do this?
>
> perhaps someone can put this forward as a new feature request?
>


I *believe* when you create an outgoing socket you can specify the local
end to bind to. My C is not very good i'm afraid, so i could be taking
rubbish here, but I think there are constants that normally 'bind' to
any or the best available ip address.

The routing there on in should be quite simple - either you have
appropriate subnets defined for each ip address and the router can work
it all out, or you can use ip rule to create source based routing - this
may be helpful for you irrespective of my understanding of the socket
library:

here is an example i use at home - my primary subnet is 10.2.1.* NATTED
onto the internet.  I have a vpn on 10.193.2.* which i route out to my
work.  My home computers live on 10.2.1.x and have normal internet
routing, my vpn laptop lives on 10.193.2.1 and by using the following
rules has its own unique ip routing table with a different default gateway!
(192.168.1.5 is the remote gateway on the VPN)
ip rule add from 10.193.2.0/24 table 2         # use routing table 2
ip route add default via 192.168.1.5 table 2   # default = vpn
ip route add 10.2.1.0/24 dev eth0 table 2      # allow lan access
ip route add 10.193.2.0/24 dev eth0            # normal routing!
ip route add 10.193.2.0/24 dev eth0 table 2    # in table 2 also!


Again, this could be quite convoluted and i could be miles off topic by
now, but I do have quite a lot of experience of odd linux based routing
setups, if they are relevant :)

Iain