Routing emails through non-gateway... how?

Tyler Aviss tjaviss-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Fri Jul 17 14:39:16 UTC 2009


Depends on what email server you're connecting to. In the case of
normal routing, it's IP-based, not port-based, so you're not going to
be able to change something specifically to mail (port
25/110/143/993/995) without delving into firewall rules, unless you do
it for all connections to [the IP of] your mailserver.


For the routing methods
If, for example, your normal gateway was at:
192.168.253.1 / eth0


By default, you might have something like (from the "route" command):

Destination      Gateway           Genmask    Flags   Metric   Ref
   Use   Iface
default             192.168.253.1   0.0.0.0        UG      0
 0           0       eth0

This is saying that, by default, all traffic flows through the gateway
at 192.168.253.1 via eth0

OK, so what if you have a mail server at 256.199.23.7 (not a real IP,
example use only), and you want all traffic to that going through a
*different* gateway. In this case, we'll use the example that this
gateway is connected via eth1, and is located at IP 10.10.10.1

route add -host 256.199.23.7 gw 10.10.10.1 dev eth1

Then you should have something like (from route):
Destination      Gateway           Genmask    Flags   Metric   Ref
   Use   Iface
default             192.168.253.1   0.0.0.0        UG      0
 0           0       eth0
256.199.23.7   10.10.10.1      255.255.255.255   UGH 1           0
       0      eth1


Both of the above, of course, assume that your NIC's are wired
correctly and have IP's that can access the named 192.x or 10.x
networks on which the gateways reside.


Depending on you network configuration, this could also likely be done
specific to the given port via firewall rules (iptables) and nat (dnat
redirection or something like that).


Hope that's helpful,


TJA

On Fri, Jul 17, 2009 at 12:56 AM, William Park<opengeometry-FFYn/CNdgSA at public.gmane.org> wrote:
> Hi all,
>
> If my default gateway is on eth0, how do I route all email through
> another interface, say eth1 or ppp0 ?
>
> Any pointer or keywords would be appreciated.
>
> --
> William Park <opengeometry-FFYn/CNdgSA at public.gmane.org>
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>



-- 
Tyler Aviss
Systems Support
LPIC/LPIC-2
(778) 890-0942
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list