public inbox for gentoo-server@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-server] how to route outgoing emails through a specific network card or ip
@ 2007-05-17 10:15 widyachacra
  2007-05-17 11:13 ` Matthias Bethke
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: widyachacra @ 2007-05-17 10:15 UTC (permalink / raw
  To: gentoo-server

[-- Attachment #1: Type: text/plain, Size: 329 bytes --]

we have two internet links. one is a leased line other one is an ADSL
broadband line. now i need to route our outgoing emails through the ADSL
broadband line. how can i do that?

we're using Qmail.

how to route outgoing emails through a specific network card or IP ADDRESS?

Please help me.

-- 
---

- Widyachacra Rajapaksha -

[-- Attachment #2: Type: text/html, Size: 380 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-server] how to route outgoing emails through a specific network card or ip
  2007-05-17 10:15 [gentoo-server] how to route outgoing emails through a specific network card or ip widyachacra
@ 2007-05-17 11:13 ` Matthias Bethke
  2007-05-17 12:32   ` rdmurray
  2007-05-17 11:21 ` Alex Efros
  2007-05-17 12:28 ` Xavier Neys
  2 siblings, 1 reply; 12+ messages in thread
From: Matthias Bethke @ 2007-05-17 11:13 UTC (permalink / raw
  To: gentoo-server

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

Hi widyachacra,
on Thursday, 2007-05-17 at 16:15:29, you wrote:
> we have two internet links. one is a leased line other one is an ADSL
> broadband line. now i need to route our outgoing emails through the ADSL
> broadband line. how can i do that?

Can you use your DSL provider's mail server as a "smarthost"? If so,
regular routing should take care of it as it will be less hops to that
host via the DSL interface. Or you could set up an explicit route to it.
If not...well, I've never done it, but how about blocking outgoing
connections to port 25 on the leased-line interface using iptables? Not
the cleanest solution but it should work for now---there's certainly a
better one if you know qmail well, which I don't.

cheers!
	Matthias
-- 
I prefer encrypted and signed messages. KeyID: FAC37665
Fingerprint: 8C16 3F0A A6FC DF0D 19B0  8DEF 48D9 1700 FAC3 7665

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-server] how to route outgoing emails through a specific network card or ip
  2007-05-17 10:15 [gentoo-server] how to route outgoing emails through a specific network card or ip widyachacra
  2007-05-17 11:13 ` Matthias Bethke
@ 2007-05-17 11:21 ` Alex Efros
  2007-05-17 12:28 ` Xavier Neys
  2 siblings, 0 replies; 12+ messages in thread
From: Alex Efros @ 2007-05-17 11:21 UTC (permalink / raw
  To: gentoo-server

Hi!

On Thu, May 17, 2007 at 04:15:29PM +0600, widyachacra wrote:
> how to route outgoing emails through a specific network card or IP ADDRESS?

1) emerge iproute2
2) RTFM about 'ip rule ...', 'ip route ...' and 'iptables ...'

-- 
			WBR, Alex.
-- 
gentoo-server@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-server] how to route outgoing emails through a specific network card or ip
  2007-05-17 10:15 [gentoo-server] how to route outgoing emails through a specific network card or ip widyachacra
  2007-05-17 11:13 ` Matthias Bethke
  2007-05-17 11:21 ` Alex Efros
@ 2007-05-17 12:28 ` Xavier Neys
  2007-05-17 12:35   ` Alex Efros
  2 siblings, 1 reply; 12+ messages in thread
From: Xavier Neys @ 2007-05-17 12:28 UTC (permalink / raw
  To: gentoo-server

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

widyachacra wrote:
> we have two internet links. one is a leased line other one is an ADSL
> broadband line. now i need to route our outgoing emails through the ADSL
> broadband line. how can i do that?
> 
> we're using Qmail.
> 
> how to route outgoing emails through a specific network card or IP ADDRESS?
> 
> Please help me.

I had the same issue when I had to force my mail to use my ADSL connection
instead of my cable connection which is my default route because my cable IP
was blacklisted.

I solved it by marking packets to port 25 and then routing them via my adsl route.
I used the following script on my router where eth2 connects to my LAN on
10.0.0.0.
192.168.1.1 is my adsl router on eth0 and eth1 is my cable modem.

...
# Force mail to be sent via ADSL because @home is blacklisted
iptables -v -t mangle -A PREROUTING -i eth2 -p tcp --dport 25 \
-j MARK --set-mark 2
...

## ROUTING ##

# Define adsl routing table used by packets MARK'ed with 0x02
ip rule add fwmark 2 table adsl
ip route add 10.0.0.0/24 dev eth2 table adsl
ip route add 127.0.0.0/8 dev lo table adsl
ip route add default via 192.168.1.1 dev eth0 table adsl

# Define cable routing table used by packets MARK'ed with 0x01
ip rule add fwmark 1 table cable
ip route add 10.0.0.0/24 dev eth2 table cable
ip route add 127.0.0.0/8 dev lo table cable
ip route add default via 82.73.126.1 dev eth1 table cable


Hope this helps,
-- 
/  Xavier Neys
\_ Gentoo Documentation Project
/
/\ http://www.gentoo.org/doc/en/


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-server] how to route outgoing emails through a specific network card or ip
  2007-05-17 11:13 ` Matthias Bethke
@ 2007-05-17 12:32   ` rdmurray
  2007-05-17 12:42     ` Xavier Neys
  0 siblings, 1 reply; 12+ messages in thread
From: rdmurray @ 2007-05-17 12:32 UTC (permalink / raw
  To: gentoo-server

On Thu, 17 May 2007 at 13:13, Matthias Bethke wrote:
> the cleanest solution but it should work for now---there's certainly a
> better one if you know qmail well, which I don't.

I doubt that.  This is a purely ip level routing
issue, not something that can be handled at
the application level unless you are using a smart
host.

iptables is what the OP needs.

--David
-- 
gentoo-server@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-server] how to route outgoing emails through a specific network card or ip
  2007-05-17 12:28 ` Xavier Neys
@ 2007-05-17 12:35   ` Alex Efros
  2007-05-17 12:43     ` Xavier Neys
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Efros @ 2007-05-17 12:35 UTC (permalink / raw
  To: gentoo-server

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

Hi!

On Thu, May 17, 2007 at 02:28:37PM +0200, Xavier Neys wrote:
> ip rule add fwmark 2 table adsl
> ip rule add fwmark 1 table cable

Your forget to note what names of these tables 'adsl' and 'cable' must be
added to /etc/iproute2/rt_tables, for example:

echo '1    adsl'  >> /etc/iproute2/rt_tables
echo '2    cable' >> /etc/iproute2/rt_tables

-- 
			WBR, Alex.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-server] how to route outgoing emails through a specific network card or ip
  2007-05-17 12:32   ` rdmurray
@ 2007-05-17 12:42     ` Xavier Neys
  2007-05-17 13:54       ` rdmurray
  0 siblings, 1 reply; 12+ messages in thread
From: Xavier Neys @ 2007-05-17 12:42 UTC (permalink / raw
  To: gentoo-server

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

rdmurray@bitdance.com wrote:
> On Thu, 17 May 2007 at 13:13, Matthias Bethke wrote:
>> the cleanest solution but it should work for now---there's certainly a
>> better one if you know qmail well, which I don't.
> 
> I doubt that.  This is a purely ip level routing
> issue, not something that can be handled at
> the application level unless you are using a smart
> host.
> 
> iptables is what the OP needs.

Not necessarily. If you use your ISP as a smarthost, then you just define a
route to it via the right interface.


Cheers,
-- 
/  Xavier Neys
\_ Gentoo Documentation Project
/
/\ http://www.gentoo.org/doc/en/


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-server] how to route outgoing emails through a specific network card or ip
  2007-05-17 12:35   ` Alex Efros
@ 2007-05-17 12:43     ` Xavier Neys
  0 siblings, 0 replies; 12+ messages in thread
From: Xavier Neys @ 2007-05-17 12:43 UTC (permalink / raw
  To: gentoo-server

[-- Attachment #1: Type: text/plain, Size: 529 bytes --]

Alex Efros wrote:
> Hi!
> 
> On Thu, May 17, 2007 at 02:28:37PM +0200, Xavier Neys wrote:
>> ip rule add fwmark 2 table adsl
>> ip rule add fwmark 1 table cable
> 
> Your forget to note what names of these tables 'adsl' and 'cable' must be
> added to /etc/iproute2/rt_tables, for example:
> 
> echo '1    adsl'  >> /etc/iproute2/rt_tables
> echo '2    cable' >> /etc/iproute2/rt_tables

Right.

Thanks for the reminder,
-- 
/  Xavier Neys
\_ Gentoo Documentation Project
/
/\ http://www.gentoo.org/doc/en/


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-server] how to route outgoing emails through a specific network card or ip
  2007-05-17 12:42     ` Xavier Neys
@ 2007-05-17 13:54       ` rdmurray
  2007-05-17 14:06         ` Xavier Neys
  0 siblings, 1 reply; 12+ messages in thread
From: rdmurray @ 2007-05-17 13:54 UTC (permalink / raw
  To: gentoo-server

On Thu, 17 May 2007 at 14:42, Xavier Neys wrote:
> rdmurray@bitdance.com wrote:
>> On Thu, 17 May 2007 at 13:13, Matthias Bethke wrote:
>>> the cleanest solution but it should work for now---there's certainly a
>>> better one if you know qmail well, which I don't.
>>
>> I doubt that.  This is a purely ip level routing
>> issue, not something that can be handled at
>> the application level unless you are using a smart
>> host.
>>
>> iptables is what the OP needs.
>
> Not necessarily. If you use your ISP as a smarthost, then you just define a
> route to it via the right interface.

I believe I said that: "unless you are using a smarthost".  :)

--David
-- 
gentoo-server@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-server] how to route outgoing emails through a specific network card or ip
  2007-05-17 13:54       ` rdmurray
@ 2007-05-17 14:06         ` Xavier Neys
  2007-05-18  4:51           ` widyachacra
  0 siblings, 1 reply; 12+ messages in thread
From: Xavier Neys @ 2007-05-17 14:06 UTC (permalink / raw
  To: gentoo-server

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

rdmurray@bitdance.com wrote:
> On Thu, 17 May 2007 at 14:42, Xavier Neys wrote:
>> rdmurray@bitdance.com wrote:
>>> On Thu, 17 May 2007 at 13:13, Matthias Bethke wrote:
>>>> the cleanest solution but it should work for now---there's certainly a
>>>> better one if you know qmail well, which I don't.
>>>
>>> I doubt that.  This is a purely ip level routing
>>> issue, not something that can be handled at
>>> the application level unless you are using a smart
>>> host.
>>>
>>> iptables is what the OP needs.
>>
>> Not necessarily. If you use your ISP as a smarthost, then you just
>> define a
>> route to it via the right interface.
> 
> I believe I said that: "unless you are using a smarthost".  :)

Sorry about that.
I saw two levels, i.e. "iptables is what the OP needs." as a reply to your reply.
My mistake :)


Cheers,
-- 
/  Xavier Neys
\_ Gentoo Documentation Project
/
/\ http://www.gentoo.org/doc/en/


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-server] how to route outgoing emails through a specific network card or ip
  2007-05-17 14:06         ` Xavier Neys
@ 2007-05-18  4:51           ` widyachacra
  2007-05-23 18:52             ` A. Khattri
  0 siblings, 1 reply; 12+ messages in thread
From: widyachacra @ 2007-05-18  4:51 UTC (permalink / raw
  To: gentoo-server

[-- Attachment #1: Type: text/plain, Size: 1155 bytes --]

Dear all,

how to tell qmail to put all its outgoing mails through this port or ip?

On 5/17/07, Xavier Neys <neysx@gentoo.org> wrote:
>
> rdmurray@bitdance.com wrote:
> > On Thu, 17 May 2007 at 14:42, Xavier Neys wrote:
> >> rdmurray@bitdance.com wrote:
> >>> On Thu, 17 May 2007 at 13:13, Matthias Bethke wrote:
> >>>> the cleanest solution but it should work for now---there's certainly
> a
> >>>> better one if you know qmail well, which I don't.
> >>>
> >>> I doubt that.  This is a purely ip level routing
> >>> issue, not something that can be handled at
> >>> the application level unless you are using a smart
> >>> host.
> >>>
> >>> iptables is what the OP needs.
> >>
> >> Not necessarily. If you use your ISP as a smarthost, then you just
> >> define a
> >> route to it via the right interface.
> >
> > I believe I said that: "unless you are using a smarthost".  :)
>
> Sorry about that.
> I saw two levels, i.e. "iptables is what the OP needs." as a reply to your
> reply.
> My mistake :)
>
>
> Cheers,
> --
> /  Xavier Neys
> \_ Gentoo Documentation Project
> /
> /\ http://www.gentoo.org/doc/en/
>
>
>


-- 
---

- Widyachacra Rajapaksha -

[-- Attachment #2: Type: text/html, Size: 1819 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-server] how to route outgoing emails through a specific network card or ip
  2007-05-18  4:51           ` widyachacra
@ 2007-05-23 18:52             ` A. Khattri
  0 siblings, 0 replies; 12+ messages in thread
From: A. Khattri @ 2007-05-23 18:52 UTC (permalink / raw
  To: gentoo-server

On Fri, 18 May 2007, widyachacra wrote:

> how to tell qmail to put all its outgoing mails through this port or ip?

Couldn't you use smtproutes to do this (i.e. /var/qmail/smtproutes) ?

man qmail-remote


>
> On 5/17/07, Xavier Neys <neysx@gentoo.org> wrote:
> >
> > rdmurray@bitdance.com wrote:
> > > On Thu, 17 May 2007 at 14:42, Xavier Neys wrote:
> > >> rdmurray@bitdance.com wrote:
> > >>> On Thu, 17 May 2007 at 13:13, Matthias Bethke wrote:
> > >>>> the cleanest solution but it should work for now---there's certainly
> > a
> > >>>> better one if you know qmail well, which I don't.
> > >>>
> > >>> I doubt that.  This is a purely ip level routing
> > >>> issue, not something that can be handled at
> > >>> the application level unless you are using a smart
> > >>> host.
> > >>>
> > >>> iptables is what the OP needs.
> > >>
> > >> Not necessarily. If you use your ISP as a smarthost, then you just
> > >> define a
> > >> route to it via the right interface.
> > >
> > > I believe I said that: "unless you are using a smarthost".  :)
> >
> > Sorry about that.
> > I saw two levels, i.e. "iptables is what the OP needs." as a reply to your
> > reply.
> > My mistake :)
> >
> >
> > Cheers,
> > --
> > /  Xavier Neys
> > \_ Gentoo Documentation Project
> > /
> > /\ http://www.gentoo.org/doc/en/
> >
> >
> >
>
>
>

-- 
A
-- 
gentoo-server@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-05-23 18:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-17 10:15 [gentoo-server] how to route outgoing emails through a specific network card or ip widyachacra
2007-05-17 11:13 ` Matthias Bethke
2007-05-17 12:32   ` rdmurray
2007-05-17 12:42     ` Xavier Neys
2007-05-17 13:54       ` rdmurray
2007-05-17 14:06         ` Xavier Neys
2007-05-18  4:51           ` widyachacra
2007-05-23 18:52             ` A. Khattri
2007-05-17 11:21 ` Alex Efros
2007-05-17 12:28 ` Xavier Neys
2007-05-17 12:35   ` Alex Efros
2007-05-17 12:43     ` Xavier Neys

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox