@fragged:
So you are trying to download a file from an internal server using your pfSense's WAN IP? Why? The problem you are seeing is NAT reflection. Just simply use the internal hostname or IP of the webserver.
Good point fragged… but i have to use the external domain name as the webserver uses the host header names to direct the request to the correct website on the server.
pfsense is port forwarding port 80 to the internal LAN IP of the web server. The domain name is used to direct which hosted site the webserver responds to.
The webserver is fully configured and working with several domains associated with it.
the default webserver is usually disabled, i only enabled it for teting this issue. So dumping a txt file on the default website is not possible for live work.
just seen BBcan177's reply too....
stand by i will just test using the url with host name, doamin and IP address etc.
to see what works and what does not.
oh... for reference 1:1 NAT is disabled
console Results for: fetch -o testfile.txt "URL"
----Test Group 1----
using ip URL= h-t-t-p://x.x.x.x/pfsense/mylist.txt works ok
using Hostname h-t-t-p://localservername/pfsense/mylist.txt works ok
using Hostname and domain h-t-t-p://localservername.mydomain.co.uk/pfsense/mylist.txt works ok
----Test Group 2----
using domain h-t-t-p://mydomain.co.uk/pfsense/mylist.txt Fails.
using www.domain h-t-t-p://www.mydomain.co.uk/pfsense/mylist.txt Fails.
----Test Group 3----
ping domain ping mydomain.co.uk resolves ok.
ping www.domain ping www.mydomain.co.uk resolves ok.
Test group 1 all point to internal IP of webserver.... these all work so internal DNS lookup fine.
Test group 2 all point to WAN IP of router.... these all fail when used from the router console.
Test group 3 all point to WAN IP of router.... these all work ok when used from the router console ping.
**Moment of Inspiration!
Added "www" as a host pointing to the internal lan ip of the webserver in the DNS forwarder.
I can now resolve www.mydomain.co.uk to the internal ip of the web server.**
I think the key here is that the web server uses host headers to identify the website to access.
it expects to see "www.mysite.co.uk" in full.
so "mysite.co.uk" will not return a result.
hence the first test in group 2 failed and now works with "www" added.
pfsense now resolves www as an internal ip and at the same time has the full correct host header.
If this had not of worked my next step would have been..
Setup DNS to return a different result internally to externally, split-horizon DNS as BBcan177 suggested.
found this in the forum if this helps anyone….
https://doc.pfsense.org/index.php/Why_can%27t_I_access_forwarded_ports_on_my_WAN_IP_from_my_LAN/OPTx_networks%3F
Thank you very much for the info and advice... very much helped keep the brain cells working.
Thank you all.
18gr .22 800fps ::)