Configuring PF for NAT
I'm trying to set up pf on OpenBSD 5.1 to act as a router, but am having some trouble.
I have two network interfaces:
- urtw0 (internet)
- em0 (trusted internal network)
I want to route all traffic from the em0 network to the internet, and allow SSH connections from em0 to sshd on the OpenBSD box. All other ports should be closed.
My pf.conf looks like this:
pass out on egress from em0:network to any nat-to (egress)
pass in on em0 proto tcp to self port 22
... But with these rules, I can't get to the internet from em0. If I change the last rule in pf.conf to:
pass in on em0
...then it works fine. I don't know much about pf (I'm more of an iptables person), but it looks like I need to actually open the ports I want to route. I don't want to open all ports on em0 - I only want port 22 to be open.
How can I do this?
|Thread||Thread Starter||Forum||Replies||Last Post|
|Configuring X with 9800gt fails.||Daffy||OpenBSD General||8||27th February 2012 02:21 PM|
|Problems configuring carp||nocturnal||OpenBSD General||0||23rd October 2011 02:58 PM|
|configuring second NIC||tomp||OpenBSD Installation and Upgrading||19||15th August 2011 08:25 PM|
|Help configuring pine||cssgalactic||FreeBSD General||4||30th June 2008 12:50 AM|
|Need Help Configuring Postfix||iainnitro||General software and network||6||8th June 2008 05:55 AM|