Hello, First of all my thanks to everyone who has been helping me with my FreeBSD, pf, and Openvpn issue over the past few days. It is much appreciated.
The good news is I have it, FreeBSD, pf, and Openvpn with the external Windows client now working, that is I can connect. I can ping the 192.168.0.1 vpn server address, as well as from server to client I haven't done much else but it is working. The bad news is I have it by accident, I'm not sure how or why it is working. I don't think it should be. Below I've placed the relevant portions of my before (non-working) and after (working) pf configuration files In the working configuration there's no rdr lines, shouldn't there be? Non-working pf configuration: ext_if="vtnet0" vpn_if = "tun0" vpnnet="192.168.0.0/24" udp_services="{7, ftp-data, ftp, ssh, smtp, 43, domain, bootps, bootpc, http, ntp, imap, https, submission, imaps, 1194, 3690, 6277, 24441}" # This line is required for dns, removing the 1194 from this line did not effect the outcome vpn="192.168.0.1" set skip on tun0 scrub on $ext_if all random-id min-ttl 254 max-mss 1452 reassemble tcp fragment reassemble # Are these values correct? nat on $ext_if from $vpnnet to any -> ($ext_if) static-port rdr on $ext_if inet proto udp to $ext_if port 1194 -> $vpn port 1194 pass inet proto tcp from { self, $jailnet, $vpnnet } to any port $tcp_services $tcpstate pass inet proto udp from { self, $jailnet, $vpnnet } to port $udp_services $udpstate # Pass traffic to the vpn pass inet proto { tcp, udp } to $vpn port 1194 $udpstate Working pf configuration: ext_if="vtnet0" vpn_if = "tun0" vpnnet="192.168.0.0/24" vpn="192.168.0.1" set skip on tun0 scrub on $ext_if all random-id min-ttl 254 max-mss 1452 reassemble tcp fragment reassemble nat on $ext_if inet from $vpnnet to any -> $ext_if # Pass traffic to the vpn pass in quick on $ext_if proto udp from any to $ext_if port 1194 keep state I'm wondering why my second config works? Are my scrub values right. Here's my server's network device configurations: vtnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=6c07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6> ether EthernetAddress inet6 fe80::f03c:91ff:fedf:6fc%vtnet0 prefixlen 64 scopeid 0x1 inet6 inet6Address autoconf inet xxx.xxx.xxx.xxx netmask 0xffffff00 broadcast xxx.xxx.xxx.255 nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL> media: Ethernet 10Gbase-T <full-duplex> status: active tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500 options=80000<LINKSTATE> inet6 fe80::6424:fcc1:8d67:8fc6%tun0 prefixlen 64 scopeid 0x4 inet 192.168.0.1 --> 192.168.0.2 netmask 0xffffff00 nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> Opened by PID 81855 pflog0: flags=141<UP,RUNNING,PROMISC> metric 0 mtu 33160 I'm also curious as to whether my tls configuration is correct, using the most secure ciphers and protocols and pfs for both the control and data channels? Do I also need to uncomment the lz4 lines? Here's the relevant portions of my client and server configs: server configuration: local xxx.xxx.xxx.xxxport 1194 proto udp4 dev tun0 ca /usr/local/etc/openvpn/keys/ca.crt cert /usr/local/etc/openvpn/keys/openvpn-server.crt key /usr/local/etc/openvpn/keys/openvpn-server.key # This file should be kept secret dh /usr/local/etc/openvpn/keys/dh.pem topology subnet server 192.168.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt ;client-config-dir ccd ;route 10.9.0.0 255.255.255.252 # Then add this line to ccd/Thelonious: # ifconfig-push 10.9.0.1 10.9.0.2 ;push "redirect-gateway def1 bypass-dhcp" push "dhcp-option DNS 208.67.222.222" push "dhcp-option DNS 208.67.220.220" ;client-to-client keepalive 10 120 tls-auth /usr/local/etc/openvpn/keys/ta.key 0 # This file is secret cipher AES-256-GCM ;compress lz4-v2 ;push "compress lz4-v2" max-clients 16 user nobody group nobody persist-key persist-tun status /var/log/openvpn/openvpn-status.log log /var/log/openvpn/openvpn.log verb 4 mute 20 mute-replay-warnings remote-cert-tls client tls-version-min 1.2 auth SHA512 tls-cipher TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256:TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256:TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256 explicit-exit-notify 1 client configuration: client dev tun proto udp4 tun-mtu 1500 remote xxx.xxx.xxx.xxx 1194 resolv-retry infinite nobind persist-key persist-tun mute-replay-warnings ca ca.crt cert client1.crt key client1.key tls-auth ta.key 1 remote-cert-tls server cipher AES-256-GCM verb 4 tls-version-min 1.2 tls-cipher TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256:TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256:TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256 auth SHA512 route-method exe route-delay 5 route-metric 550 Thanks again. Dave. On 4/20/17, David Mehler <dave.meh...@gmail.com> wrote: > Hello, > > Thank you for your reply. I did: > tcpdump -n -e -i pflog0 > > It's not giving me any output. From the perspective of the client it's > waiting for a connection that's not happening, from the perspective of > the server it's not even seeing the client connection atempt, the > firewall is stomping it dead and not giving any explanation. If this > helps here's a pfctl -sr my rules: > > pfctl -sr > scrub on vtnet0 all random-id min-ttl 254 max-mss 1452 reassemble tcp > fragment reassemble > block drop in on ! lo1 inet from 10.0.0.15 to any > block drop in on ! lo1 inet from 10.0.0.16 to any > block drop in on ! lo1 inet from 10.0.0.17 to any > block drop in on ! vtnet0 inet from 66.228.47.0/24 to any > block drop in inet from 66.228.47.34 to any > block drop in on ! vtnet0 inet6 from 2600:3c03::/64 to any > block drop in on vtnet0 inet6 from fe80::f03c:91ff:fedf:6fc to any > block drop in inet6 from 2600:3c03::f03c:91ff:fedf:6fc to any > block drop log all > block drop in quick on vtnet0 inet proto tcp all flags FPU/FPU > block drop in quick on vtnet0 from <martians> to any > block drop in quick from <blocked_countries> to any > block drop in quick from <bruteforce> to any > block drop in quick from <fail2ban> to any > block drop in quick from <droplasso> to any > block drop in quick from <ZeuS> to any > block drop in quick from <malwaredomain> to any > block drop in quick from <evasive> to any > block drop quick inet6 all > block drop out quick on vtnet0 from any to <martians> > pass inet proto icmp all icmp-type echoreq keep state > pass inet proto icmp all icmp-type unreach keep state > pass inet proto udp from any to any port 33433:33626 keep state > pass inet proto tcp from 66.228.47.34 to any port = echo flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = ftp-data flags > S/SA modulate state > pass inet proto tcp from 66.228.47.34 to any port = ftp flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = ssh flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = smtp flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = nicname flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = domain flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = bootps flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = bootpc flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = http flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = ntp flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = imap flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = https flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = submission flags > S/SA modulate state > pass inet proto tcp from 66.228.47.34 to any port = imaps flags S/SA > modulate state > pass inet proto tcp from 66.228.47.34 to any port = 2703 flags S/SA > modulate state > pass inet proto tcp from 127.0.0.1 to any port = echo flags S/SA modulate > state > pass inet proto tcp from 127.0.0.1 to any port = ftp-data flags S/SA > modulate state > pass inet proto tcp from 127.0.0.1 to any port = ftp flags S/SA modulate > state > pass inet proto tcp from 127.0.0.1 to any port = ssh flags S/SA modulate > state > pass inet proto tcp from 127.0.0.1 to any port = smtp flags S/SA modulate > state > pass inet proto tcp from 127.0.0.1 to any port = nicname flags S/SA > modulate state > pass inet proto tcp from 127.0.0.1 to any port = domain flags S/SA > modulate state > pass inet proto tcp from 127.0.0.1 to any port = bootps flags S/SA > modulate state > pass inet proto tcp from 127.0.0.1 to any port = bootpc flags S/SA > modulate state > pass inet proto tcp from 127.0.0.1 to any port = http flags S/SA modulate > state > pass inet proto tcp from 127.0.0.1 to any port = ntp flags S/SA modulate > state > pass inet proto tcp from 127.0.0.1 to any port = imap flags S/SA modulate > state > pass inet proto tcp from 127.0.0.1 to any port = https flags S/SA modulate > state > pass inet proto tcp from 127.0.0.1 to any port = submission flags S/SA > modulate state > pass inet proto tcp from 127.0.0.1 to any port = imaps flags S/SA modulate > state > pass inet proto tcp from 127.0.0.1 to any port = 2703 flags S/SA modulate > state > pass inet proto tcp from 192.168.0.1 to any port = echo flags S/SA > modulate state > pass inet proto tcp from 192.168.0.1 to any port = ftp-data flags S/SA > modulate state > pass inet proto tcp from 192.168.0.1 to any port = ftp flags S/SA modulate > state > pass inet proto tcp from 192.168.0.1 to any port = ssh flags S/SA modulate > state > pass inet proto tcp from 192.168.0.1 to any port = smtp flags S/SA > modulate state > pass inet proto tcp from 192.168.0.1 to any port = nicname flags S/SA > modulate state > pass inet proto tcp from 192.168.0.1 to any port = domain flags S/SA > modulate state > pass inet proto tcp from 192.168.0.1 to any port = bootps flags S/SA > modulate state > pass inet proto tcp from 192.168.0.1 to any port = bootpc flags S/SA > modulate state > pass inet proto tcp from 192.168.0.1 to any port = http flags S/SA > modulate state > pass inet proto tcp from 192.168.0.1 to any port = ntp flags S/SA modulate > state > pass inet proto tcp from 192.168.0.1 to any port = imap flags S/SA > modulate state > pass inet proto tcp from 192.168.0.1 to any port = https flags S/SA > modulate state > pass inet proto tcp from 192.168.0.1 to any port = submission flags > S/SA modulate state > pass inet proto tcp from 192.168.0.1 to any port = imaps flags S/SA > modulate state > pass inet proto tcp from 192.168.0.1 to any port = 2703 flags S/SA > modulate state > pass inet proto tcp from 10.0.0.0/8 to any port = echo flags S/SA modulate > state > pass inet proto tcp from 10.0.0.0/8 to any port = ftp-data flags S/SA > modulate state > pass inet proto tcp from 10.0.0.0/8 to any port = ftp flags S/SA modulate > state > pass inet proto tcp from 10.0.0.0/8 to any port = ssh flags S/SA modulate > state > pass inet proto tcp from 10.0.0.0/8 to any port = smtp flags S/SA modulate > state > pass inet proto tcp from 10.0.0.0/8 to any port = nicname flags S/SA > modulate state > pass inet proto tcp from 10.0.0.0/8 to any port = domain flags S/SA > modulate state > pass inet proto tcp from 10.0.0.0/8 to any port = bootps flags S/SA > modulate state > pass inet proto tcp from 10.0.0.0/8 to any port = bootpc flags S/SA > modulate state > pass inet proto tcp from 10.0.0.0/8 to any port = http flags S/SA modulate > state > pass inet proto tcp from 10.0.0.0/8 to any port = ntp flags S/SA modulate > state > pass inet proto tcp from 10.0.0.0/8 to any port = imap flags S/SA modulate > state > pass inet proto tcp from 10.0.0.0/8 to any port = https flags S/SA > modulate state > pass inet proto tcp from 10.0.0.0/8 to any port = submission flags > S/SA modulate state > pass inet proto tcp from 10.0.0.0/8 to any port = imaps flags S/SA > modulate state > pass inet proto tcp from 10.0.0.0/8 to any port = 2703 flags S/SA modulate > state > pass inet proto udp from 66.228.47.34 to any port = echo keep state > pass inet proto udp from 66.228.47.34 to any port = ftp-data keep state > pass inet proto udp from 66.228.47.34 to any port = ftp keep state > pass inet proto udp from 66.228.47.34 to any port = ssh keep state > pass inet proto udp from 66.228.47.34 to any port = smtp keep state > pass inet proto udp from 66.228.47.34 to any port = nicname keep state > pass inet proto udp from 66.228.47.34 to any port = domain keep state > pass inet proto udp from 66.228.47.34 to any port = bootps keep state > pass inet proto udp from 66.228.47.34 to any port = bootpc keep state > pass inet proto udp from 66.228.47.34 to any port = http keep state > pass inet proto udp from 66.228.47.34 to any port = ntp keep state > pass inet proto udp from 66.228.47.34 to any port = imap keep state > pass inet proto udp from 66.228.47.34 to any port = https keep state > pass inet proto udp from 66.228.47.34 to any port = submission keep state > pass inet proto udp from 66.228.47.34 to any port = imaps keep state > pass inet proto udp from 66.228.47.34 to any port = svn keep state > pass inet proto udp from 66.228.47.34 to any port = 6277 keep state > pass inet proto udp from 66.228.47.34 to any port = 24441 keep state > pass inet proto udp from 127.0.0.1 to any port = echo keep state > pass inet proto udp from 127.0.0.1 to any port = ftp-data keep state > pass inet proto udp from 127.0.0.1 to any port = ftp keep state > pass inet proto udp from 127.0.0.1 to any port = ssh keep state > pass inet proto udp from 127.0.0.1 to any port = smtp keep state > pass inet proto udp from 127.0.0.1 to any port = nicname keep state > pass inet proto udp from 127.0.0.1 to any port = domain keep state > pass inet proto udp from 127.0.0.1 to any port = bootps keep state > pass inet proto udp from 127.0.0.1 to any port = bootpc keep state > pass inet proto udp from 127.0.0.1 to any port = http keep state > pass inet proto udp from 127.0.0.1 to any port = ntp keep state > pass inet proto udp from 127.0.0.1 to any port = imap keep state > pass inet proto udp from 127.0.0.1 to any port = https keep state > pass inet proto udp from 127.0.0.1 to any port = submission keep state > pass inet proto udp from 127.0.0.1 to any port = imaps keep state > pass inet proto udp from 127.0.0.1 to any port = svn keep state > pass inet proto udp from 127.0.0.1 to any port = 6277 keep state > pass inet proto udp from 127.0.0.1 to any port = 24441 keep state > pass inet proto udp from 192.168.0.1 to any port = echo keep state > pass inet proto udp from 192.168.0.1 to any port = ftp-data keep state > pass inet proto udp from 192.168.0.1 to any port = ftp keep state > pass inet proto udp from 192.168.0.1 to any port = ssh keep state > pass inet proto udp from 192.168.0.1 to any port = smtp keep state > pass inet proto udp from 192.168.0.1 to any port = nicname keep state > pass inet proto udp from 192.168.0.1 to any port = domain keep state > pass inet proto udp from 192.168.0.1 to any port = bootps keep state > pass inet proto udp from 192.168.0.1 to any port = bootpc keep state > pass inet proto udp from 192.168.0.1 to any port = http keep state > pass inet proto udp from 192.168.0.1 to any port = ntp keep state > pass inet proto udp from 192.168.0.1 to any port = imap keep state > pass inet proto udp from 192.168.0.1 to any port = https keep state > pass inet proto udp from 192.168.0.1 to any port = submission keep state > pass inet proto udp from 192.168.0.1 to any port = imaps keep state > pass inet proto udp from 192.168.0.1 to any port = svn keep state > pass inet proto udp from 192.168.0.1 to any port = 6277 keep state > pass inet proto udp from 192.168.0.1 to any port = 24441 keep state > pass inet proto udp from 10.0.0.0/8 to any port = echo keep state > pass inet proto udp from 10.0.0.0/8 to any port = ftp-data keep state > pass inet proto udp from 10.0.0.0/8 to any port = ftp keep state > pass inet proto udp from 10.0.0.0/8 to any port = ssh keep state > pass inet proto udp from 10.0.0.0/8 to any port = smtp keep state > pass inet proto udp from 10.0.0.0/8 to any port = nicname keep state > pass inet proto udp from 10.0.0.0/8 to any port = domain keep state > pass inet proto udp from 10.0.0.0/8 to any port = bootps keep state > pass inet proto udp from 10.0.0.0/8 to any port = bootpc keep state > pass inet proto udp from 10.0.0.0/8 to any port = http keep state > pass inet proto udp from 10.0.0.0/8 to any port = ntp keep state > pass inet proto udp from 10.0.0.0/8 to any port = imap keep state > pass inet proto udp from 10.0.0.0/8 to any port = https keep state > pass inet proto udp from 10.0.0.0/8 to any port = submission keep state > pass inet proto udp from 10.0.0.0/8 to any port = imaps keep state > pass inet proto udp from 10.0.0.0/8 to any port = svn keep state > pass inet proto udp from 10.0.0.0/8 to any port = 6277 keep state > pass inet proto udp from 10.0.0.0/8 to any port = 24441 keep state > pass in inet proto tcp from any to 66.228.47.34 port = ssh flags S/SA > keep state (source-track rule, max-src-conn 15, max-src-conn-rate 5/3, > overload <bruteforce> flush global, src.track 3) > pass in inet proto tcp from any to 10.0.0.15 port = 2220 flags S/SA > keep state (source-track rule, max-src-conn 15, max-src-conn-rate 5/3, > overload <bruteforce> flush global, src.track 3) > pass inet proto tcp from any to 10.0.0.15 port = 2220 flags S/SA keep state > pass in inet proto tcp from any to 10.0.0.16 port = 2221 flags S/SA > keep state (source-track rule, max-src-conn 15, max-src-conn-rate 5/3, > overload <bruteforce> flush global, src.track 3) > pass inet proto tcp from any to 10.0.0.16 port = 2221 flags S/SA keep state > pass in inet proto tcp from any to 10.0.0.17 port = 2222 flags S/SA > keep state (source-track rule, max-src-conn 15, max-src-conn-rate 5/3, > overload <bruteforce> flush global, src.track 3) > pass inet proto tcp from any to 10.0.0.17 port = 2222 flags S/SA keep state > pass in inet proto tcp from any to 10.0.0.18 port = 2223 flags S/SA > keep state (source-track rule, max-src-conn 15, max-src-conn-rate 5/3, > overload <bruteforce> flush global, src.track 3) > pass inet proto tcp from any to 10.0.0.18 port = 2223 flags S/SA keep state > pass in inet proto udp from any to 192.168.0.1 port = openvpn keep state > pass in inet proto tcp from any to 66.228.47.34 port = http flags S/SA > keep state (source-track rule, max-src-conn 15, max-src-conn-rate 5/3, > overload <bruteforce> flush global, src.track 3) > pass in inet proto tcp from any to 66.228.47.34 port = https flags > S/SA keep state (source-track rule, max-src-conn 15, max-src-conn-rate > 5/3, overload <bruteforce> flush global, src.track 3) > pass in inet proto tcp from any to 66.228.47.34 port = smtp flags S/SA > keep state (source-track rule, max-src-conn 15, max-src-conn-rate 5/3, > overload <bruteforce> flush global, src.track 3) > pass in inet proto tcp from any to 66.228.47.34 port = submission > flags S/SA keep state (source-track rule, max-src-conn 15, > max-src-conn-rate 5/3, overload <bruteforce> flush global, src.track > 3) > pass in inet proto tcp from any to 66.228.47.34 port = imaps flags > S/SA keep state (source-track rule, max-src-conn 15, max-src-conn-rate > 5/3, overload <bruteforce> flush global, src.track 3) > pass inet proto tcp from any to 10.0.0.17 port = sip flags S/SA keep state > pass inet proto tcp from any to 10.0.0.17 port = sip-tls flags S/SA keep > state > pass inet proto tcp from any to 10.0.0.17 port 10000:10500 flags S/SA keep > state > pass inet proto udp from any to 10.0.0.17 port = sip keep state > pass inet proto udp from any to 10.0.0.17 port = sip-tls keep state > pass inet proto udp from any to 10.0.0.17 port 10000:10500 keep state > > tcpdump -n -e -i pflog0 > tcpdump: WARNING: pflog0: no IPv4 address assigned > tcpdump: verbose output suppressed, use -v or -vv for full protocol decode > listening on pflog0, link-type PFLOG (OpenBSD pflog file), capture > size 65535 bytes > 0 packets captured > 0 packets received by filter > 0 packets dropped by kernel > > ifconfig tun0 > tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500 > options=80000<LINKSTATE> > inet6 fe80::6424:fcc1:8d67:8fc6%tun0 prefixlen 64 scopeid 0x4 > inet 192.168.0.1 --> 192.168.0.2 netmask 0xffffff00 > nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> > Opened by PID 49670 > > Thanks. > Dave. > > > On 4/20/17, Gert Doering <g...@greenie.muc.de> wrote: >> HI, >> >> On Thu, Apr 20, 2017 at 08:18:47AM -0400, David Mehler wrote: >>> Is anyone using OpenVPN on a FreeBSD server? >> >> Didn't I already say so? >> >>> I've confirmed the >>> problem is in fact the firewall, I'm using pf on the server. If I take >>> the firewall down things work fine. >>> >>> Are there other ports I have to enable? Currently the only one I'm >>> letting through for openvpn is 1194 both tcp and udp. >> >> Enable pflog, do "tcpdump -n -e -i pflog0" and it will tell you which >> packets are dropped. >> >> Which ports you need depend on your OpenVPN setup - and you normally >> do not need TCP *and* UDP, unless you run two server processes, one >> for TCP and one for UDP. >> >> gert >> -- >> USENET is *not* the non-clickable part of WWW! >> >> //www.muc.de/~gert/ >> Gert Doering - Munich, Germany >> g...@greenie.muc.de >> fax: +49-89-35655025 >> g...@net.informatik.tu-muenchen.de >> > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Openvpn-users mailing list Openvpn-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-users