Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

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.