Open a port to a specific external IP



  • 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 :)


  • LAYER 8 Global Moderator

    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?





Log in to reply