You are here
Perry Lund - Thu, 2015/12/31 - 07:00
We have a virtualized instance of Turnkey Moodle is working great under HyperV. Access to the Moodle server is fine on the internal network at our school. However, people trying to hit the server outside of our network from home can not get to the server. We tested routing to another server to test our firewall rules and that narrowed down our problem to the Turnkey Moodle server itself. The server does not appear to route NAT traffic back to the requesting web browser from external sources. Can anyone assist me in configuring our Turnkey Linux Moodle server to accept and return NAT requests? Thanks.
Perry Lund
Evergreen Lutheran High School
Forum:
When testing this did you reroute the existing port forward?
Bottom line is though that this should just work OOTB. The only thing to keep in mind that you will need to forward port 443 (https).
Rerouting
With our Sonicwall, I simply changed the service name (Moodle) to the test IP. Once that worked, I reverted the Moodle service to the Moodle IP. I did not create a new entry. We used IPs of 80 and 443 and 65118. These exist on the Moodle server as well.
The odd thing is that all those port work internally on the LAN with the Moodle Server. But coming in from the outside does NOT work. Port forwarding seems to work fine, but the server does not seem to be able to response with the traffic going back through the firewall to the outside world where the request came from in the first place.
=======
Perry Lund
Sorry for slow reply
I haven't explicitly tried this recently; but I have done similar stuff ewith TurnKey on my (consumer grade) router (i.e. local install; prot forwarded through NAT) and it has worked fine! I'm just downloading now so I can try specifically with Moodle v14.0
Still TBH I'd be somewhat surprised if it didn't work. But I'm already surprised that it doesn't work for you!?
Out of interest have you checked the Apache access logs (/var/www/apache2/access.log) to ensure that the request is actually getting through to the TurnKey Server? Other than that how can you be sure that the initial request is getting through?
In the past similar issues have been caused by IP conflict; but that doesn't make sense here as you can work with it locally. Also one other things that occurs to me is that if you are using a domain name; perhaps there is some funky redirection going on somewhere?
Testing more
I found a little time to test with network utility.
Port scanning port 80 and 443 does not complete. However, the 65112 port that is setup does complete.
However I can not connect to the server from my web browser windows.
I can not find the apache www access log inside the webmin interface for Turnkey yet.
=======
Perry Lund
What is the 65118 port?
As for finding the Apache log I suggest that you just use the commandline. It's much quicker and easier IMO. Either use Webshell (https on port 12320) or if on Windows use PuTTY (google will find it); if using Mac just open a terminal and type
Then to get the last 20 lines of the access log: You'll ideally want someone to try it externally and then check straight away. If they are connecting then it should show their IP in the log. If it does you could also try checking the error log to see if that shows anything (/var/log/apaches2/error.log) - use the same command (tail) to showthe last 20 lines.What is the 65118 port?
As for finding the Apache log I suggest that you just use the commandline. It's much quicker and easier IMO. Either use Webshell (https on port 12320) or if on Windows use PuTTY (google will find it); if using Mac just open a terminal and type
Then to get the last 20 lines of the access log: You'll ideally want someone to try it externally and then check straight away. If they are connecting then it should show their IP in the log. If it does you could also try checking the error log to see if that shows anything (/var/log/apaches2/error.log) - use the same command (tail) to showthe last 20 lines.65118
Port 65118 was created as an external firewall port setup to pass through from external network to our internal network. Perhaps that is the issue. No port 65118 is needed.
=======
Perry Lund
Ah... So you have it configured to use that port externally?
Is there are reason not to just use 80 & 443? IMO there is no real value in using an additional extra port for external connections. You should be able to use the same ports for local and remote access (so long as you set up your NAT port forwarding correctly).
If you do think that there is a reason, then you'll need to actually enable the port in Apache too. Just creating a virtual host for that port isn't enough. You need to tell Apache to listen to that port too. I'm not sure how you do it in Webmin; but from the commandline do something this:
Webmin and Apache ports
The creation of a virtual host for that port automatically added the listen port. I check the configuration file and port 65118 was there and being listened too.
At this point, I may need to just use a physical PC as a host for the Moodle server in place of our HyperV virtual machine solution on our Windows 2012 server. Another box to put up and another day.
Prior to my entrance to this work place, someone tried an Asterisk box for VoIP in a virtual machine and it failed too in NAT configuration. Asterisk is a physical box and works fine.
=======
Perry Lund
Ok I'll take your word for it.
So thinking this through some more, I'd like to summarise where we are up to. Please correct me if I'm wrong:
I wonder if there is something weird going on with your Hyper-V host? From a router perspective it should not matter whether it is redirecting to a physical machine or a virtual one. Maybe that is why the Asterix VM failed too? Although TBH Asterisk routing is much more complicated than a simple webserver. Another factor for Asterisk too, is that it is quite resource heavy and from my reading Hyper-V isn't super resource efficient (although TBH I've never used it so can't really comment). FWIW I started using ProxmoxVE as a hypervisor about 5 years ago and haven't looked back...
Anyway, assuming that I have it all right, it doesn't make any sense to me. By it's nature a NAT router only stops incoming traffic (not outgoing). So I'm almost certain that the traffic isn't making it to your VM from outside your LAN. My first guess would be the router (i.e. port forwarding rules) but by your accounts you have ruled that out. My next guess would be something to do with your Hyper-V host (like a firewall or something) but that doesn't make sense as it works fine on the LAN.
IMO there's definitely something funky going on with your network. I urge you to use a packet sniffing tool like WireShark to see what is really going on with the incoming packets. Although it looks like a TurnKey issue on the surface; I'm 99.9% sure that it's not!
Add new comment