Is it possible to open a internal Moodle server to internet using NAT 1:1?
-
Hi,
I'm new to Pfsense and i have already configured the firewall in order to secure my moodle server rather than putting it directly facing Internet using an available public IP.
I only have a one WAN gateway with a public IP and LAN interface does not have a gateway. Pfsense is running on a HyperV VM on top of Windows server 2016.
-
WAN interface is static and has a public IP provided by the ISP. (xxx.xxx.219.154) and the WAN gateway is (xxx.xxx.219.153)
-
LAN interface IP is DHCP and has the IP 192.168.1.254 hard coded to the LAN interface.
-
My Moodle server is on 192.168.1.10 and its properly running in the LAN. This IP is hard coded to the Moodle config file.
I have tried to NAT the internal server with a another public IP which has been given by the ISP.(xxx.xxx.219.158)
However, when i try to connect from internet (other than my internet connection), web page url jumps to to the intranet IP (192.168.1.10) and gets the error "Site can not be reached.".
When i type xxx.xxx.219.158 from my LAN, I get the PF sense login page.
Am i doing something wrong here or is it not possible since the LAN IP is hard coded to the moodle config file?. As per my understanding it should be possible.
Any advice and help regarding this matter will be highly appreciated.
-
-
Sorry for troubling you guys. I got it solved by adding following line to the moodle config file. (Instead of using a hardcoded IP)
$CFG->wwwroot = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].'/lms';