Annotation of src/etc/pf.conf, Revision 1.4
1.4 ! henning 1: # $OpenBSD$
1.1 kjell 2: #
1.2 smart 3: # See pf.conf(5) for syntax and examples
1.4 ! henning 4: #
! 5: # replace ext0 with external interface name, 10.0.0.0/8 with internal network
! 6: # and 192.168.1.1 with external address
! 7: #
! 8: # nat: packets going out through ext0 with source address 10.0.0.0/8 will get
! 9: # translated as coming from 192.168.1.1. a state is created for such packets,
! 10: # and incoming packets will be redirected to the internal address.
! 11:
! 12: # nat on ext0 from 10.0.0.0/8 to any -> 192.168.1.1
! 13:
! 14: # rdr: packets coming in through ext0 with destination 192.168.1.1:1234 will
! 15: # be redirected to 10.1.1.1:5678. a state is created for such packets, and
! 16: # outgoing packets will be translated as coming from the external address.
1.1 kjell 17:
1.4 ! henning 18: # rdr on ext0 proto tcp from any to 192.168.1.1/32 port 1234 -> 10.1.1.1 port 5678
! 19:
! 20: # filter rules
! 21: # the implicit first two rules are
1.1 kjell 22: # pass in all
23: # pass out all
1.4 ! henning 24:
! 25: # block all incoming packets but allow ssh, pass all outgoing tcp and udp
! 26: # connections and keep state
! 27: # log blocked pakets
! 28:
! 29: # block in log all
! 30: # pass in on ext0 proto tcp from any to ext0 port 22 keep state
! 31: # pass out on ext0 proto { tcp, udp } all keep state
! 32: