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

    Pfsense 2.4 vpn on port 443

    Scheduled Pinned Locked Moved webGUI
    9 Posts 6 Posters 5.1k 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.
    • A
      Actionhenk
      last edited by

      Hello, I upgraded pfsense from 2.3 to 2.4. I had a vpn running on port 443 tcp and after upgrading I can no longer connect to the webgui of pfsense because the port is in use.. I did not have this issue with 2.3, is there anyway to have the webgui still working on port 443 and also have vpn on port 443 without downgrading to pf 2.3 ?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • Z
        zskwrel
        last edited by

        In your OpenVPN server configuration under Advanced Configuration near the bottom of the page you'll see a 'Custom Options' box. Add the following command:```
        port-share localhost 443

        1 Reply Last reply Reply Quote 0
        • K
          kejianshi
          last edited by

          Port sharing works but if I remember right performance can be diminished.  I always just move my web GUI to a different port.

          1 Reply Last reply Reply Quote 0
          • Z
            zskwrel
            last edited by

            Sorry, I should also add that since you cannot get to the WebGui you need to drop into the shell (option 8) from your console. From there, runps aux | grep openvpnto find the PID your OpenVPN server is running on. Kill it with```
            kill -9 22188

            1 Reply Last reply Reply Quote 0
            • Z
              zskwrel
              last edited by

              @kejianshi:

              Port sharing works but if I remember right performance can be diminished.  I always just move my web GUI to a different port.

              It's strange, but I had the same problem as the OP when I originally tried setting up OpenVPN on port 443/TCP even though my pfSense web gui was already moved to port 369. I could not use both services at the same time until I added the port share option to OpenVPN.  :-\

              1 Reply Last reply Reply Quote 0
              • A
                Actionhenk
                last edited by

                Thanks for the fast response. Adding the port sharing option worked!

                1 Reply Last reply Reply Quote 0
                • jimpJ
                  jimp Rebel Alliance Developer Netgate
                  last edited by

                  You can't have two daemons bound to the same port. Move the GUI to another port, and you can use port-share to pass through HTTPS if you want after that.

                  Otherwise you're setting up a race condition to see who can bind to 443 first and it may not always work out how you want.

                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

                  1 Reply Last reply Reply Quote 0
                  • D
                    Dalesjo
                    last edited by

                    @jimp:

                    You can't have two daemons bound to the same port. Move the GUI to another port, and you can use port-share to pass through HTTPS if you want after that.

                    Otherwise you're setting up a race condition to see who can bind to 443 first and it may not always work out how you want.

                    I was about to start a new thread about this as a potential security issue. I have been running with this setup ignorant about the issue for years.

                    If you bind your OpenVPN server to wan only it used to work in this order:

                    • OpenVPN starts first, if the wan interface is up it successfully binds.

                    • webconfigurator/nginx binds to all interfaces.

                    So if your wan interface is down at startup OpenVPN wont start and webconfigurator will bind to port 443 on the wan first.

                    Yes the easy fix is to change the port of Webconfigurator but wouldn't it be prudent to lock Nginx down?

                    If I may be so bold i would like see a solution with a checkbox in System / Advanced / Admin / Access saying something like, "only allow access through Lan Interface IP". Which would change the current listen 443 ssl; to listen 192.168.0.1:443 ssl; (or whatever your lan ip number is) in /var/etc/nginx-webConfigurator.conf

                    1 Reply Last reply Reply Quote 0
                    • S
                      Soyokaze
                      last edited by

                      @Dalesjo:

                      If I may be so bold i would like see a solution with a checkbox in System / Advanced / Admin / Access saying something like, "only allow access through Lan Interface IP". Which would change the current listen 443 ssl; to listen 192.168.0.1:443 ssl; (or whatever your lan ip number is) in /var/etc/nginx-webConfigurator.conf

                      And after some time you renumbering your subnets, change LAN interface IP and BAM! You have no WebGUI. And no means to reactivate it, because this setting is, you know, in WebGUI.

                      Also - restricting bind to only 1 IP is very restrictive in administrative perspective - I had multiple situations when I needed access to WebGUI through non-LAN interfaces. Also - Captive Portal…

                      Considering 'OpenVPN on TCP/443' is pretty popular scenario, but definitely not standard (and considered ''advanced'') - this collision should be resolved only by moving WebGUI binding to some other than 443 port and disabling autoredirect rule.

                      Need full pfSense in a cloud? PM for details!

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.