New User Help! Azure Pfsense, I Can't See Website

  • Hello,

    I am trying to access my website via its public IP (52.x.x.x) but it keeps trying to connect me to Pfsense GUI even though I specify port 80 for the web server and provide a port forward NAT. I keep getting redirected to port 443 on my web link: http:// 52.x.x.x. Am I doing something wrong in the NAT? Here is my setup:

    Azure Config:
    Azure Network Space:
    WAN NIC IP of address space
    Added Another IP with External IP: 52.x.x.x <- (This is for the website)
    LAN NIC of address space <- (Going to use this as next hop when routing to internet from server)
    Website NIC of address space
    Azure NSG for Pfsense NIC and Website Server NIC:
    Inbound: Allow x.x.x.x <- (My Computer) to Any destination on Any port on all NICS

    Pfsense Config:
    WAN NIC IP of (Static) Gateway:
    LAN NIC of (Static) Gateway:
    Firewall Rules: Allow x.x.x.x on Destination Port 80 to Any Destination
    NAT Rule Port Forward:
    (Destination Address): 52.x.x.x Redirect target IP: Port: http (Everything else is left at default)
    Virtual IP (IP Alias):
    Firewall Rules are open to my Public IP x.x.x.x and allowed to access any destination on Port 80

  • I have tried everything, including following everything in the article below. I do no think this is a problem with Azure Network Security Groups because I opened all access to that port

  • Bump

  • Netgate Administrator

    Hmm, well if you are hitting the redirect to port 443 then your traffic is not matching the port forward.

    Check the state table when you try to connect to the virtual IP. What states are open to that? If the source correct?

    You should probably not have a gateway on LAN. Doing so will cause pfSense to NAT the traffic outbound there to the LAN IP. If you have to have that, because it's dhcp, switch to manual outbound NAT mode and remove the NAT rules on LAN.


  • @stephenw10
    Thank you for the reply

    Strange, it is showing the traffic I expected on the states table minus the redirect. I was expecting a destination of then traffic gets redirected to In the states table traffic is coming in from my public IP x.x.x.x to destination and it is not getting redirected to It shows to be connected on port 80 in the states table. I replaced the three octets with x for privacy on the public IP:




    Also, I changed the LAN interface from DHCP to static, added the IP, and removed the gateway.

  • Netgate Administrator

    Ah, it's probably not matching because your port forward rule is set to catch traffic with destination 52.x.x.x. But by the time it reaches pfSense it has been forwarded by Azure to so that needs to be the destination in the pfSense rule.


  • @stephenw10

    It is now redirecting correctly, :80 ( <--(Original Destination), but I am not getting any traffic through: 4a91b823-5a87-48fe-9507-e33e569b66af-image.png

    Here are my two rules to permit traffic on port 80 in Pfsense:328fabf1-385d-4d24-b522-9cdedf2062f5-image.png

    Here are my Inbound Rules in Azure, same Network Security Group, different NICs (I double checked this):

  • Netgate Administrator

    Local firewall on the server blocking it? There are zero bytes coming back there.


  • I added an Inbound rule to the firewall but it still didn't allow me to see the website. 8a1bb380-d082-47c7-8f15-de7569b2f9f4-image.png

    I tried removing the local firewall completely, but I was unable to see the site. I removed the Public IP from the Pfsense NIC associated to IP and placed it directly on the Website NIC in Azure192.168.2.4 and turned the firewall back on and was able to see the site but it is not going through Pfsense anymore :(

    I am removing the association and putting it public IP back on the Pfsesense NIC IP with

    Here are my firewall rules on Pfsesense and Azure:
    Here are my two rules to permit traffic on port 80 in Pfsense WAN interface ( I have not added any rules to the LAN interface):328fabf1-385d-4d24-b522-9cdedf2062f5-image.png

    Here are my Inbound Rules in Azure, same Network Security Group, for all NICs (I double checked this):

  • Netgate Administrator

    Is the server using the pfSense LAN as it's default gateway? Or being routed there by Azure?

    Without that the server may be replying directly and you get out of state TCP blocks. (asymmetric routing)


  • @stephenw10
    I don't think it is. Is the best way to do that by changing the NIC adapter settings or should I make a static route in Azure?

  • Netgate Administrator

    Better to route it in Azure otherwise you have to add that to all VMs there. It;s unclear if you actually have two subnets there though. It looks like you might just be using "Azure Network Space:". That could make the routing difficult, you might have to static route on the server.


  • @stephenw10
    I made three subnets out of a possible four from the address space
    I felt that it might be a good idea so I can later add a static route if necessary :)

    I tried adding a route to Azure: Address Prefix: Next Hop: Associated Subnet:, but I had no luck

    I added static route in cmd route add -p MASK, but still nothing :(

    I even tried it after killing the session states


  • Netgate Administrator

    The route you need to add is via That will allow the server to route back to any external client via pfSense.

    But you need to apply that to only devices in and you might not be able to do that in Azure unless you really have separate subnets.


  • I went ahead and tried it anyway, it being add the VM to the subnet. I made the VM IP and tried creating a static route via cmd for MASK It didn't seem to work. I tried it in Azure as a static route but I found that Azure can only route between different subnets.

    Sorry, I am so confused :( ??? Why does the LAN interface subnet need to contain the website VM? Azure will not let me route through that IP if my VM is in the same subnet (

  • Netgate Administrator

    Replies from the server must go back through pfSense. Otherwise the firewall will only see part of the TCP conversation and will block out of state packets. Check the firewall log.

    The only other way to do it is to NAT the traffic as it leaves LAN so the server replies back to that directly as it's in the same subnet.


  • @stephenw10
    Holy Moley! That worked! You are the best, thank you!!! Switching IPs to the same subnet as the LAN then creating route next hop to subnet in Azure worked like a charm!

    Thanks again! :)

  • Netgate Administrator

    No worries. 👍

Log in to reply