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

    Open a port to a specific external IP

    Scheduled Pinned Locked Moved NAT
    2 Posts 2 Posters 1.8k 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
      arnada
      last edited by

      Hello,

      I want one of my clients to be able to access mysql on port 3306 on their external IP.

      I don't want to open port 3306 to the public only to my clients external IP.

      I have tried setting source address to my clients public IP when creating a NAT rule
      without any success.

      Could someone kindly point me in the right direction :)

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by

        Did you setup client source port, this is a common mistake.  Your rule would be something simple

        lets say your clients IP address is 1.2.3.4, and your msql server listening on 3306 is on your private network 192.168.1.142

        This would be your port forward, and it will auto create your firewall rule - notice that the nat is linked to firewall.  That little double arrow thing on the left of the port forward.

        First thing I would check is that you actually see the traffic on your wan to this port from your client.  Simple sniff on your wan interface, packet capture under diag menu on pfsense.

        Its quite possible that client doesn't allow this port out in the first place?  Please run through https://doc.pfsense.org/index.php/Port_Forward_Troubleshooting

        Common problem is pfsense is behind a nat, and the port forward is not setup on the nat device in front of pfsense.  Pfsense has public IP on its wan address?  Or does it have a rfc1918 address?

        nat.png
        firewallrule.png
        nat.png_thumb
        firewallrule.png_thumb

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

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