All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dorneles Treméa" <dorneles@x3ng.com.br>
To: lartc@vger.kernel.org
Subject: [LARTC] Routing SMTP traffic
Date: Fri, 04 Jul 2003 03:15:24 +0000	[thread overview]
Message-ID: <marc-lartc-105728898731574@msgid-missing> (raw)

Hi guys,

I have a mail server running qmail with two network
interfaces. All packages comes from the first one and
I want to mark outgoing packages to route them using
the second interface (ADSL).

I have write this script, but it ins't work. All
packages are returning by the first interface... :-(

x-x-x

# Tables, networks, interfaces, addresses and gateways
IF1=eth0
T1\x100
NET1 0.180.193.16/29
IP1 0.180.193.18
GW1 0.180.193.20

IF2=eth1
T2 0
NET2\x192.168.1.0/24
IP2\x192.168.1.100
GW2\x192.168.1.1

# Mark packages that have TCP DST PORT 25 with 1
iptables -A PREROUTING -t mangle -p tcp --dport 25 -j MARK --set-mark 1

# Define routing in tables $T1 and $T2
ip route add $NET1 dev $IF1 src $IP1 table $T1
ip route add default via $GW1 table $T1
ip route add $NET2 dev $IF2 src $IP2 table $T2
ip route add default via $GW2 table $T2

# Define routing in table 'main'
ip route add $NET1 dev $IF1 src $IP1
ip route add $NET2 dev $IF2 src $IP2

# Define default route normal
ip route add default via $GW1

# Define routing rule for same interface
ip rule add from $IP1 table $T1
ip rule add from $IP2 table $T2

# Define routing rule for marked packages
ip rule add fwmark 1 table $T2

x-x-x

Could someone enlighten me? :-)

Best regards,

-- 

Dorneles Treméa
Caxias do Sul - RS - Brasil
+55 54 9114 9312 - UIN: 2413568
X3ng Web Technology <http://www.x3ng.com.br>

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/IT d- s:->: a23 C+++ UBL++++$ P--- L++ E-- W+++
N++ o? K? w+ O M+ V-- PS+ PE- Y-- PGP++ t+ 5 X++ R+
tv+ b(++) DI+ D++ G+>+++ e++>++++ h---- r+++ y+++**
------END GEEK CODE BLOCK------


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

             reply	other threads:[~2003-07-04  3:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-04  3:15 Dorneles Treméa [this message]
2003-07-04  4:56 ` [LARTC] Routing SMTP traffic Eric Leblond
2003-07-04 14:27 ` Dorneles Treméa
2003-07-08 14:15 ` Hanno Mueller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-105728898731574@msgid-missing \
    --to=dorneles@x3ng.com.br \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.