From nobody Tue Dec 28 07:27:10 2021 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 03944190DF57 for ; Tue, 28 Dec 2021 07:28:35 +0000 (UTC) (envelope-from freebsd-database@pp.dyndns.biz) Received: from keymaster.home (ns1.xn--wesstrm-f1a.se [81.4.102.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "keymaster.pp.dyndns.biz", Issuer "keymaster.pp.dyndns.biz" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JNR3P6ndGz4qm2 for ; Tue, 28 Dec 2021 07:28:33 +0000 (UTC) (envelope-from freebsd-database@pp.dyndns.biz) Received: from [192.168.254.0] ([192.168.254.0]) by keymaster.home (8.16.1/8.16.1) with ESMTP id 1BS7RAJ3035520 for ; Tue, 28 Dec 2021 08:27:11 +0100 (CET) (envelope-from freebsd-database@pp.dyndns.biz) Message-ID: <5f2cca65-daab-989c-5fd0-6a5373f5bd56@pp.dyndns.biz> Date: Tue, 28 Dec 2021 08:27:10 +0100 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: PF and tun1 Content-Language: en-GB To: questions@freebsd.org References: From: =?UTF-8?Q?Morgan_Wesstr=c3=b6m?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4JNR3P6ndGz4qm2 X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-database@pp.dyndns.biz has no SPF policy when checking 81.4.102.176) smtp.mailfrom=freebsd-database@pp.dyndns.biz X-Spamd-Result: default: False [2.28 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; HFILTER_HELO_IP_A(1.00)[keymaster.home]; NEURAL_HAM_SHORT(-0.99)[-0.987]; NEURAL_SPAM_LONG(0.73)[0.728]; HFILTER_HELO_NORES_A_OR_MX(0.30)[keymaster.home]; NEURAL_HAM_MEDIUM(-0.49)[-0.492]; R_SPF_NA(0.00)[no SPF record]; DMARC_NA(0.00)[pp.dyndns.biz]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:198203, ipnet:81.4.100.0/22, country:NL]; RCVD_COUNT_TWO(0.00)[2]; R_MIXED_CHARSET(0.83)[subject] X-ThisMailContainsUnwantedMimeParts: N On 2021-12-28 02:55, Alex Thomas wrote: > I am trying to get nebula working on tun1 with pf as my firewall. If I > turn pf off, everything works. How to I tell pf to ignore / let > everything pass on the tun1 device. > > vtnet0 = "vtnet0" > nebula1 = "tun1" > icmp_types = "{ echoreq unreach }" > table persist > table { 0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 127.0.0.0/8 > 169.254.0.0/16 \ > 172.16.0.0/12 192.0.0.0/24 192.0.0.0/29 192.0.2.0/24 > 192.88.99.0/24 \ > 192.168.0.0/16 198.18.0.0/15 198.51.100.0/24 > 203.0.113.0/24 \ > 240.0.0.0/4 255.255.255.255/32 } > > set skip on lo0 > set skip on tun1 > set skip on $nebula1 > scrub in all fragment reassemble max-mss 1440 > antispoof quick for $vtnet0 > block in quick on egress from > block return out quick on egress to > block all > pass in on $vtnet0 proto tcp to port { 22222 } \ > keep state (max-src-conn 15, max-src-conn-rate 3/1, \ > overload flush global) > pass out proto { tcp udp } to port { 22 53 80 123 443 } > pass out inet proto icmp icmp-type $icmp_types > In my experience the skip rules only work on interfaces that are available when pf starts, which excludes tun-interfaces. I don't know if this is by design. Remove your skip rules for tun1 and $nebula1 and just add a pass rule for that interface: pass on tun1 all Additionally, since you're quick blocking all traffic to and from private IP addresses, make sure you don't use any of those IP addresses on tun1. /Morgan