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

Cannot forward port 80

I know this has to have been answered a million times but a search didn't turn up a useful answer for me.

I have a web server on port 80 that works just fine on a conventional router but I can't seem to configure asg to forward the inbound requests to port 80.  Here's my NAT and PF rules attached.  I've carefully screened the process but obviously I'm missing something.  I can ping the web server from an ssh session on asg.  Thoughts?


This thread was automatically locked due to age.
  • Hi, BitSprocket, and welcome to the User BB!

    Since you selected 'Automatic packet filter rule', you don't need the manual rule you also configured.

    Since you've just started with Astaro, I guess that you've just added it to your network, and that your web server still has some other device configured as its default gateway.

    Cheers - Bob
  • Hi, BitSprocket, and welcome to the User BB!

    Since you selected 'Automatic packet filter rule', you don't need the manual rule you also configured.

    Since you've just started with Astaro, I guess that you've just added it to your network, and that your web server still has some other device configured as its default gateway.

    Cheers - Bob


    You are right, I did have the gateway of the web server pointing to the old router.  Fixed that and rebooted but still getting the same issue.
  • It seems that no matter what DNAT configuration I use for any service, the packets are not being forwarded to the host.  I've tried three different services (www, ssh, splunk (port 9997)) and none of them work.

    For clarity, I moved the ssh port on ASG to 2222 and am able to log in from my public IP address just fine.  I have ssh running on my local machine at port 22 and can log in fine from inside the firewall with no problems.  In spite of having set up the DNAT and packet filters, I cannot establish a connection to my local machine using my public IP address.  I've tinkered with the packet filter rules to be sure there was nothing blocking (i.e. deliberatly trying to ssh to the wrong port to see if the log would contain an entry and it does.  The correct port does not show any log entries.)

    Based on three services failing to respond from my external IP address, and no packet filters reporting drops in the logs (for the associated ports) I must conclude that I am not forwarding the packets to their intended host (via NAT) properly.

    I'm going to concentrate my efforts on the NAT configuration unless someone has a better idea.  Any help or advice would be greatly appreciated!
  • How do you like that.  The solution I found was to use FULL NAT instead of DNAT.  I really don't understand the flow of packets (source and destination seem backwards to me) but it is working.  Anybody care to enlighten me?
  • You shouldn't need the extra packet filter rule(s) as long as you select the automatic rule.  Your DNAT was correct and should have been sufficient.  Do you have a masq rule like 'Internal (Network) -> External'?  You aren't trying to access via the external interface from inside the network, are you?

    Cheers - Bob
  • The masq rule is there by default.  I discovered that if I remove it, then nobody gets in or out (no web browsing etc making troubleshooting especially difficult.)  In fact I am trying to access the web server from the domain name from inside the network.  These rules are quite confusing to me as now I don't seem to be able to get mail (ports 25 and 110) to work properly.

    Is there a point in the docs that describes NAT in detail so I can do a bit of self study?
  • Hi, the DNAT/SNAT section of the docs would have some info, and there are also articles in the support site such as 
    https://support.astaro.com/support/index.php/How_to_Port_Forward_Service_Ports_with_NAT

    Barry
  • You aren't trying to access via the external interface from inside the network, are you?

    I am trying to access the web server from the domain name from inside the network.


    Accessing Internal or DMZ Webserver from Internal network

    Cheers - Bob
  • Barry:  I've read that link you sent which lists several great examples but I think where I'm having trouble is understanding the packet flow as it applies to those rules.  For example, it seems that the first scenario is the one I want:
    Scenario 1 - Common port on public interface
      Example: Webserver on HTTP TCP port 80

    1) Create a DNAT rule
    Goto Network Security>>NAT
    Select DNAT/SNAT tab
    New NAT rule
    Name: Webserver 
    Group: No group
    Position: Bottom
    Traffic Source: Any                                                        https://support.astaro.com/support/index.php/Connect_via_internal_lan_to_an_internal_server_over_the_external_address

    But that article isn't helpful to me either.  When I reset the DNAT rule to the above and create the SNAT rule per the article, I still cannot see my web server.  It seems that the only way to see it is to do a Full NAT.

    Where am I going wrong?

    Edit:  Apparently my impatience got the best of me.  After configuring the SNAT rule it didn't appear to work.  By the time I finished writing this post, it seems to have settled and is now working.  Question:  Why bother creating a DNAT and SNAT?  Why not just always use FULL NAT and avoid this trouble alltogether?
  • Depending on your situation, a Full NAT might be impractical.  I prefer to use a DNAT for external inbound traffic and "split DNS" (add a forward look-up zone to internal DNS) that resolves directly to the server's internal IP for requests originating from inside the network.

    I gave you the wrong link.  I knew that the correct link suggested a Full NAT like you created, so take a look at the new link.

    Cheers - Bob