• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

pfSense - Enable webGUI (port 80) access through the WAN (private) using terminal/console/shell

Scheduled Pinned Locked Moved General pfSense Questions
3 Posts 1 Posters 6.3k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E
    eduardolucioac
    last edited by eduardolucioac Jun 11, 2021, 11:10 PM Jun 11, 2021, 11:08 PM

    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 .

    1 Reply Last reply Reply Quote 0
    • E
      eduardolucioac
      last edited by Jun 12, 2021, 9:34 PM

      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.

      1 Reply Last reply Reply Quote 0
      • E
        eduardolucioac
        last edited by eduardolucioac Jun 12, 2021, 11:10 PM Jun 12, 2021, 11:05 PM

        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

        1 Reply Last reply Reply Quote 0
        1 out of 3
        • First post
          1/3
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
          This community forum collects and processes your personal information.
          consent.not_received