Changes between Version 4 and Version 5 of FreeBSD PF Firewall Examples


Ignore:
Timestamp:
03/20/21 15:13:10 (4 years ago)
Author:
Paul Kulda
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FreeBSD PF Firewall Examples

    v4 v5  
    100100# End of config
    101101}}}
     102
     103{{{
     104# default openvpn settings for the client network
     105vpnclients = "10.8.0.0/24"
     106#put your wan interface here (it will almost certainly be different)
     107wanint = "vtnet0"
     108# put your tunnel interface here, it is usually tun0
     109vpnint = "tun0"
     110# OpenVPN by default runs on udp port 1194
     111udpopen = "{1194}"
     112icmptypes = "{echoreq, unreach}"
     113
     114set skip on lo
     115# the essential line
     116nat on $wanint inet from $vpnclients to any -> $wanint
     117
     118block in
     119pass in on $wanint proto udp from any to $wanint port $udpopen
     120pass in on $wanint proto tcp from any to any port 22 keep state
     121pass in on $wanint proto tcp from any to any port 80 keep state
     122pass in on $wanint proto tcp from any to any port 443 keep state
     123# the following two lines could be made stricter if you don't trust the clients
     124pass out quick
     125pass in on $vpnint from any to any
     126pass in inet proto icmp all icmp-type $icmptypes
     127}}}
     128