How to find out what public IP address is being forwarded through PAT?

I have a need to forward a port to a virtual machine that I have set up and I was wondering if there is a way to query the firewall to see which public IP address is actively using that port forward rule. I would like to harden that port forward so that only that address can access it.

I know it would seem to be easier to just ask the user what their IP address is, but I would rather keep things simple in this situation and just ask the firewall. :slight_smile:

Thank you.

cat /proc/net/nf_conntrack

1 Like

That looks like it might work based on the info that's in it.

Thank you, I'll check it when the connection is made and grep the port number and see if it shows up :slight_smile:

1 Like