All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Routing SMTP traffic
@ 2003-07-04  3:15 Dorneles Treméa
  2003-07-04  4:56 ` Eric Leblond
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dorneles Treméa @ 2003-07-04  3:15 UTC (permalink / raw)
  To: lartc

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/

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

end of thread, other threads:[~2003-07-08 14:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-04  3:15 [LARTC] Routing SMTP traffic Dorneles Treméa
2003-07-04  4:56 ` Eric Leblond
2003-07-04 14:27 ` Dorneles Treméa
2003-07-08 14:15 ` Hanno Mueller

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.