Routing Mail Traffic Problem  - iproute2

Posted on 2005-05-12
Last Modified: 2010-03-18
Etx1 - First Internet Line  - eth0
Ext2 - Second Internet line - eth2
LAN - Local Area Network - eth1
GW1 - Gateway first Internet Line
GW2 - Second Internet Line

Other traffic - Ext1 -------+-------+--------------- Ext2 ---Web goes Here
                   eth0 |          |eth2
                  |     ROUTER      |
                          |eth1 -----------------+
                        | - Gateway
                        | -

The problem is that i can't check e-mails if server name in e-mail client is
i can check e-mail only if server addrress is

I have :
iptables -t mangle -I PREROUTING -i eth1 -s -d -p tcp --dport 110 -j MARK --set-mark 67
iptables -t mangle -I PREROUTING -i eth1 -s -d -p tcp --dport 25 -j MARK --set-mark 67

/sbin/ip route add dev eth1 table natips
/sbin/ip route add dev lo  scope link table natips
/sbin/ip route add default via dev eth1 table natips
/sbin/ip route flush cache
/sbin/ip rule add fwmark 67 table mail

But it's not working .

root@fw:/usr/src/linux# ip rule list
0:      from all lookup local
32764:  from all fwmark 0x43 lookup mail
32765:  from all fwmark 0x42 lookup natips
32766:  from all lookup main
32767:  from all lookup default

root@fw:/usr/src/linux# ip route list dev eth1  scope link dev eth0  proto kernel  scope link  src dev ipsec0  proto kernel  scope link  src dev eth2  proto kernel  scope link  src dev eth1  proto kernel  scope link  src via dev ipsec0 dev lo  scope link
default via dev eth0  metric 1
default via dev eth2  metric 2

Any help is very appreciated.
Question by:snedelchev
    LVL 19

    Expert Comment

    I'm in risk of telling something wrong here but

    why are you marking 67 the traffic to your email, while you have the natips table looking for traffic marked 42?

    32765:  from all fwmark 0x42 lookup natips

    and my other question is, why do you are using diferent tables when you can use the default?
    LVL 3

    Author Comment

    natips is only for web trafic that goes to eth2
    mail table is for route pop3 to i hope but it's not working
    because is resolved with ip of eth0  
    instead of

    i think diffrenece betwwen 42 is in HEX in Decimal is 66
    43 is 67
    LVL 3

    Author Comment

    it seams to be a resolution problem
    bcause is resolved with my external IP that is connected to the internet .
    LVL 3

    Author Comment

    This Problem is solved i setup DNS server and add new zone and host record to point to
    LVL 19

    Expert Comment


    It was one of my thoughs, but as you were at routing, I supposed you already had the domain names part solved already

    please ask for a refund of your points =)
    LVL 3

    Author Comment

    Redimido i'm wodering can i do this without DNS ?
    LVL 19

    Expert Comment

    you must not.

    in these days, to have an email server which does not respond to a valid domain name, invites the email receviers to block you.

    it is necessary for you to point your MX record to your ip in order to send/receive messages.

    if you only want your client to connect to the pop3 or imap server, then it is okay not to have DNS. you can use ip addresses only for that matter. but if the server cannot send/receive email, then it is more or less useless, don't you think?

    LVL 19

    Expert Comment

    mmhh... it's okay with me.

    Accepted Solution

    PAQ'd  and 500 points refunded

    Cleanup Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now