RE: Re: Problems with netfilter

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PROBLEM SOLVED!

I didn't have to bind the output to the mail server.

The problem was that I didn't have a SNAT rule for eth0 (the network
interface attached to the ADSL modem).

Thank god for that!



> iptables -A OUTPUT -t mangle -p tcp --dport 25 -j MARK --set-mark 25
> ip rule add fwmark 25 lookup mail
> ip route add default via xxx.xxx.xxx.xxx dev ppp0 table mail
>
> Running tcpdump it appears that port 25 traffic is be routed through the
> ADSL connection. However, the source IP address appears to be the cable IP

Correct routing is kinda odd in this case, as IPTABLES OUTPUT happens
after OUTPUT ROUTING, according to KPTD
(http://www.docum.org/stef.coene/qos/kptd).

> address (cable is the default gateway). I have put SNAT rules in place,
> however they don't seem to work.
>
> The SNAT rules I used were:
>
> iptables -t nat -A POSTROUTING -o ppp0 -j SNAT --to yyy.yyy.yyy.yyy
> and the same thing with the cable connection.
>
> Rememeber, the packets are being generated locally through the mail server
> (qmail).

IPTABLES POSTROUTING happens for both locally originated and forwarded
traffic (see KPTD); it should have worked.

Anyway, binding the mail server to the intended IP address (by adding it
to the tcpserver call) should also do this part of the job.

Rubens


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.563 / Virus Database: 355 - Release Date: 17/01/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.563 / Virus Database: 355 - Release Date: 17/01/2004

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

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux