Professional Web Applications Themes

iptables trouble - Linux Setup, Configuration & Administration

Hi All, Trying to get my firewall to route smtp to an internal mail server. 10.0(eth1) 192.168.x.x (external eth0) | | | | --------------------- | Network | 10.0.x.x Mail server iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE /etc/sysctrl net.ipv4.ip_forward= 1 iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 25 -j DNAT --to 10.0.x.x:25 The above allows all clients to share the internet connection + mail is forwarded to the mail server 10.0.x.x However no mail can be sent. Unless i drop the DNAT rule set. Everything else is set to ACCEPT. So there must be some ...

  1. #1

    Default iptables trouble

    Hi All,

    Trying to get my firewall to route smtp to an internal mail server.


    10.0(eth1) 192.168.x.x (external eth0)
    | |
    | |
    ---------------------
    |
    Network
    |
    10.0.x.x Mail server

    iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE

    /etc/sysctrl net.ipv4.ip_forward= 1

    iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 25 -j DNAT --to
    10.0.x.x:25

    The above allows all clients to share the internet connection + mail is
    forwarded to the mail server 10.0.x.x

    However no mail can be sent. Unless i drop the DNAT rule set. Everything
    else is set to ACCEPT. So there must be some sort of loop happening.

    I have tried lots of different FORWARD & OUTPUT rules but none that have
    worked as yet. Has anyone an idea of a rule that will route mail out or a
    better syntax for my DNAT rule that will not cause outgoing to queue.

    Regards,

    Luke

    Luke Guest

  2. #2

    Default Re: iptables trouble

    On Wed, 03 Sep 2003 19:21:18 +0100, Luke wrote:
    > Hi All,
    >
    > Trying to get my firewall to route smtp to an internal mail server.
    >
    >
    > 10.0(eth1) 192.168.x.x (external eth0)
    > | |
    > | |
    > ---------------------
    > |
    > Network
    > |
    > 10.0.x.x Mail server
    >
    > iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
    >
    > /etc/sysctrl net.ipv4.ip_forward= 1
    >
    > iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 25 -j DNAT --to
    > 10.0.x.x:25
    This rule belongs to OUTPUT, not to PREROUTING. As -i isn't possible in
    OUTPUT, you have to use -s (source address) instead.
    >
    > The above allows all clients to share the internet connection + mail is
    > forwarded to the mail server 10.0.x.x
    >
    > However no mail can be sent. Unless i drop the DNAT rule set. Everything
    > else is set to ACCEPT. So there must be some sort of loop happening.
    >
    > I have tried lots of different FORWARD & OUTPUT rules but none that have
    > worked as yet. Has anyone an idea of a rule that will route mail out or a
    > better syntax for my DNAT rule that will not cause outgoing to queue.
    >
    > Regards,
    >
    > Luke
    Wolfgang Fischer Guest

Similar Threads

  1. :IPTables::IPv4
    By amresh in forum PERL Modules
    Replies: 0
    Last Post: July 2nd, 07:32 AM
  2. regarding IPTables::IPv4
    By amresh in forum PERL Modules
    Replies: 0
    Last Post: July 1st, 03:30 PM
  3. iptables question
    By Theo Vermeulen in forum Linux / Unix Administration
    Replies: 2
    Last Post: July 29th, 05:06 PM
  4. NIS and IPTABLES, what ports to allow ?
    By Joe Simon in forum Linux Setup, Configuration & Administration
    Replies: 0
    Last Post: August 8th, 04:11 PM
  5. iptables disturb DNS?
    By Wenjie in forum Linux Setup, Configuration & Administration
    Replies: 1
    Last Post: July 27th, 10:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139