Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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-> port 80 tcp
share|improve this question

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:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.