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

Access local webserver fails.

I have a local Apache webserver hosting multiple websites from one IP address. It's at 192.168.1.100. I'm not using WAF. I followed the directions below:


1) Click on Network Protection
2) Click on the NAT tab
3) Click on 'New NAT Rule'
4) Under 'Matching Condition', at 'Using Service:', click the trash can, then the Green Plus. In the Destination Port, enter 80. Click Save.
5) Under 'Matching Condition', at 'Going To', click the trash can, then the folder. Options show up on the left. click and hold on 'External (WAN) (Adddress)', and drag it to the empty space next to 'Going To'. Click Save.
6) Under 'Action', 'Change the destination to:', click the trash can, then the Green Plus. Leave everything default, and add 192.168.1.100 into the IPv4 Address box. Click Save
7) Under 'Action', 'And the service to:', click the trash can, then the Green Plus. Under Destination Port, enter 80.
8) Check the box 'Automatic Firewall Rule'.
9) If you want, fill in a description of the rule in 'Comment:'
10) Click Save
11) Under the Status column, make sure there is a green checkmark. If not, click on the grey circle next to the red X.

Then,

Network Protection, NAT, NAT tab
New NAT Rule
Rule Type: Full NAT (Source + Destination)
For traffic from: Internal (Network)
Using service: HTTP
Going to: External (WAN)(Address)
Change the destination to: 192.168.1.100
And the service to: HTTP
Change the source to: Internal (Address)
And the service to: HTTP
Keep unchecked 'Automatic Firewall Rule'
Save 

When I go to http://www.mydomain.com, mydomain2.com, or mydomain3.com from the LAN, it times out, and does not access the webserver. Accessing any of these domain names outside my LAN works fine. Checking Apache's log, it appears that, instead of accessing www.mydomain.com, it is trying to access Apache's default webpage, which isn't configured. I also have a number of smaller web devices, such as IP cameras, and these all work fine. Also, this was a working configuration with pfsense.

Any ideas?


This thread was automatically locked due to age.
  • There is nothing wrong with WAF. Its apache doing mod security so your fears are unfounded. Read this article https://community.sophos.com/products/unified-threat-management/astaroorg/f/57/t/50094 to see if it helps.
  • OK, I'm looking into WAF. My problems are in another thread. WAF aside, is there a way to solve this issue?
  • Please [Go Advanced] below and attach a picture of your rules on the 'DNAT/SNAT' tab.

    Cheers - Bob
  • I couldn't find a 'DNAT/SNAT' tab, so I took pictures of the NAT config for the webserver. One is the port forwarding, and the other is to access the webserver from the LAN.
    On one, you'll notice I replaced HTTP with port 80. I did this as a troubleshooting measure. The same problem exists when the fields are HTTP.
  • Ah, you're right, the title of the tab was changed to 'NAT' in V9...  My bad! [:O]

    It is a good habit to leave a field blank when not making a change.  In the case of a service with a single destination port, this makes no difference.  In the case of a service with multiple ports, or a Service Group, repeating the service makes the NAT rule ineffective.  In NAT #1, clear out the 'And the service to' fields, Save and see if it works.

    If it still doesn't work, then, in 'Going to', try replacing "External (WAN) (Address)" with a DNS Host definition using www.mydomain.com.  I don't think this matters, but there may have been a change from V8 to V9.

    In NAT #27, select 'Log initial packets', clear the 'And the service to' field and Save.  Open the Firewall Live Log to see if the packets are captured.  Of course, the test has to be made from outside your LAN.

    Cheers - Bob
  • Thanks for the reply. I cleared out those fields, and except for one domain, everything worked fine. I'm hoping the one domain shouldn't be an issue, and may be something I broke. Out of curiosity, I put the ports back into those fields, and things still worked. Maybe it was one-time weirdness from filling in the fields I should have left blank. For good measure, I went through the rest of the NAT config, and cleared out any redundant fields.

    Thanks again!