This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NAT rule order

Hi,

Is there a way to specify rule order for NAT rules, like there is for filter rules?  I know that iptables supports this functionality, but I cannot figure out how to implement in ASL.

I recently took over an installation that's already in production, and there is a preexisting rule matching all prod_servers/all/all masquerade source address to ext_general.

I want email to go out a different interface, so I added a rule:  email_server/all/SMTP nat source to ext_email.

My rule isn't working (email is still going out ext_general).  I suspect that the first rule is higher in the rule chain than the second.  How can I determine the order in the nat rule chain, and change it?

Thanks,

Steve Sadler
  


This thread was automatically locked due to age.
  • Hi Slart,

    your problem isn't related to NAT but to the fact that ASL sends all traffic which isn't local to
    the default gateway. What you need in addition to your S-NAT rule is so called policy routing.
    This feature isn't implemented in the current version but there is an howto available at
    http://docs.astaro.org/older_versions/ASL-V3.2/docs_v3/hacking/policy_routing.txt

    Works for me very well, give it a shot!

    cyclops
       
  • I am using 4.007.
    The firewall is the DG and I have both a MASQ rule and dnat/snat rule for a host that needs a different IP address then what the MASQ provides. This machine is in the "DMZ" where I have mutiple snat/dnat rules along side a MASQ rule.

    My rule for this host exists after the MASQ rule and it works fine. The MASQ rule is the first rule in the list!

    If looking at the NAT rules this is how it is layed out:

    MyRuleName_Out - - Internal_SVR -> Any / Any   Ext_IP_Interface__  - -  None  

    Remember you need to create a network host entry for this host and be sure you used a /32 mask (All 255's)  

    Also remember you need to add a packet filter rule outbound depending on the service you are providing.
     
    Joe