Guest User!

You are not Sophos Staff.

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

routing order

I have wan1 (default route), wan2, dmz1, dmz2 and internal.
I want all the web traffic from internal to Internet go via wan2, so I add a policy routing
src: internal network
dest: any
service: 80
gateway (going via wan2).

I also create an SNAT to NAT the internal network to wan2 IP, when access service 80.

Everything seems to work fine, except now I can't access my own web server in the dmz anymore.

I do have static routes (no NAT) to connect internal to dmz, but it seems the policy route took over, or maybe the SNAT is creating trouble?

Any thoughts?


This thread was automatically locked due to age.
  • My guess is the SNAT; you probably should change it to check the destination "Internet" instead of "ANY".

    If that doesn't help, post the SNAT settings here.

    I'm not really sure you need the SNAT though.

    Barry
  • "Internet" is defined/associated with wan1 NIC. Can I use it with wan2 NIC?

    I guess SNAT is needed, or else how can the internal private IP see the outside world?
  • Hi,

    I think you will find that the access failure for your DMZ is caused by the routing sending the traffic out wan2 with no option of a higher PF rule to direct the traffic to your local server in the DMZ.

    you might consider  PF or routing with 2 rules, first one for your DMZ and the next one for your wan2.

    Ian M
  • From KB Article #290074

    - Create your secondary internet-access, e.g. DSL. When this line is established by a router in front of Astaro, create additionally the gateway-IP as a host definition.

    Webadmin -> Network -> Routing -> policy based routing, for example HTTP

    Source: External Address (that one currently with the default gateway on)
     Source Interface: Any
     Destination: Any
     Service: HTTP
    Target: Gateway-IP of your secondary Interface (even if this has none itself, since you can only define one gateway), or PPPOE-Interface-Address


    - Additionally you need SNAT-rule to replace the external IP to the new target interface. 

     Webadmin -> Network -> NAT/Masquerading 

     Source: external address of the primary line
     Destination: any
     Service: http
     Change source to: external address of the secondary interface


    Cheers - Bob
  • The article you mentioned is for proxied traffic. 

    I don't use transparent proxy, so I followed Article # 202274 in the knowledge base and setup the policy routing based on service (port 80/443). Unfortunately, web server in dmz now is inaccessible.
  • The 'Internet' object is indeed bound to the interface with the default gateway, but you would be using it in the traffic selector portion of your route and SNAT, so that's what you would want if this is your problem.

    Maybe your problem is just be that you now need a static entry in DNS.  What do you mean by "web server in dmz now is inaccessible" - you can't browse to it by FQDN or by IP? 

    When you solve the problem, please post the resolution.

    Cheers - Bob
    PS FWIW, I think 290074 should work with the HTTP proxy disabled or enabled in any mode, but not having tried it myself, I'm ready for someone to explain to me why it wouldn't.
  • The 'Internet' object is indeed bound to the interface with the default gateway, but you would be using it in the traffic selector portion of your route and SNAT, so that's what you would want if this is your problem. 

    Tried using 'Internet' with route and/or SNAT, no luck

    Maybe your problem is just be that you now need a static entry in DNS.  What do you mean by "web server in dmz now is inaccessible" - you can't browse to it by FQDN or by IP? 

    "inaccessible" means it can't be connected at the network level, using IP and port (80).



    When you solve the problem, please post the resolution.

    Cheers - Bob
    PS FWIW, I think 290074 should work with the HTTP proxy disabled or enabled in any mode, but not having tried it myself, I'm ready for someone to explain to me why it wouldn't.


    When proxy is disabled, the outbound web traffic is SNATed, in this case, to the "wan2" public IP. It won't even touch the "wan1" public IP, but 290074 talks about traffic coming from "wan1" public IP (source), which only makes sense when you have the proxy running.
  • Hi,

    I think you will find that the access failure for your DMZ is caused by the routing sending the traffic out wan2 with no option of a higher PF rule to direct the traffic to your local server in the DMZ.

    you might consider  PF or routing with 2 rules, first one for your DMZ and the next one for your wan2.

    Ian M


    I thought routing order was static route, policy route and default route. I just did some checkings/readings and it turned out the correct order should be policy route, static route, default route. The explains why the wan2 policy route "short circuited" the static route to DMZ. 
    I just added another policy route for DMZ before the one for wan2 as you suggested. All is good now. Thanks!
  • Excellent!  Thanks, Guys!

    Cheers - Bob