pfSense - Enable webGUI (port 80) access through the WAN (private) using terminal/console/shell
-
We need to access the webGUI (port 80) through the WAN (private). We also need to enable this through pfSense's terminal/console/shell.
We have already performed the following actions...
Using option 12 ("12) PHP shell + pfSense tools") perform the commands...
unset($config['interfaces']['wan']['blockpriv']); write_config(); exec;
... to disable "Block private networks and loopback addresses".
Using option 8 ("8) Shell") we add a rule to allow access through port 80 on the WAN interface...
easyrule pass wan tcp any any 80
NOTE: Using option 8 ("8) Shell") and turning off the firewall with the command...
pfctl -d
... we can access webGUI using a server from WAN (private) network.
Thanks! =D
Related issue pfSense - Enable ssh (port 22) access through the WAN using terminal/console/shell .
-
For some very strange reason I had to logoff the computer I was testing access to WebGUI (
curl http://<PFSENSE_IP>
) and then login to get it to work. Weird...EXTRA: This process is not recommended if your WAN is not private. I recommend configuring HTTPS (port 443) access to the WebGUI.
-
EXTRA CONTENT: Configure the WebGUI to use HTTPS (port 443) using pfSense's terminal/console/shell.
Using option 12 ("12) PHP shell + pfSense tools") perform the commands...
$config['system']['webgui']['protocol'] = "https"; $config['system']['webgui']['port'] = "443"; write_config(); exec;
... and exit...
exit
Use option 11 ("11) Restart webConfigurator") to restart the WebGui.
Test WebGUI access (HTTPS, port 443)...
curl -k https://10.2.0.101
NOTE: Use "-k" flag to avoid "curl" give the "SSL certificate problem" error message. This will workaround it allowing insecure connections.
[Ref(s).: https connection using CURL from command line ]NOTE: Requests on port 80 (HTTP) will automatically be redirected to port 443 (HTTPS).
TIP: This file contains many of the ways that pfSense uses to consume its settings...
vi /conf/config.xml
... based on these templates we can define ways to use option 12 ("12) PHP shell + pfSense tools") to perform configurations like this example...
$config['system']['webgui']['port'] = "443"; write_config(); exec;
.
Thanks! =D