I have freeBSD router and it host public IP address, I am using ipnat.rules to configure port forwarding prom public network inside my private network. Now I wondering can I restrict only specific public IP addresses to can pass trough my port forwarding. What I want is to only my specific public IP addresses can walk inside my network on specific ports. Here is how now look like my ipnat.rules file
rdr fxp0 217.199.XXX.XXX/32 port 7900-> 192.168.1.12 port 80 tcp
You should use a firewall like PF/IPF/IPFW to allow only specified IP addresses to access port 7900 on your router/gateway. PF can actually do all of the NAT stuff for you as well. If you to keep using IPNAT to handle your NAT, you can use IPFW or IPF to limit what hosts can access a port.
Here's the FreeBSD page that lays out the differences between firewalls:
http://www.freebsd.org/doc/handbook/firewalls.html