From nobody Tue Aug 23 09:44:56 2022 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 4MBkq509sgz4ZCrp for ; Tue, 23 Aug 2022 09:45:05 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [IPv6:2607:f3e0:0:1::12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smarthost1.sentex.ca", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MBkq35Vctz3pjQ for ; Tue, 23 Aug 2022 09:45:03 +0000 (UTC) (envelope-from mike@sentex.net) Received: from pyroxene2a.sentex.ca (pyroxene19.sentex.ca [199.212.134.19]) by smarthost1.sentex.ca (8.16.1/8.16.1) with ESMTPS id 27N9iuvM071177 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 23 Aug 2022 05:44:56 -0400 (EDT) (envelope-from mike@sentex.net) Received: from [IPV6:2607:f3e0:0:4:d906:4eb8:d33e:290f] ([IPv6:2607:f3e0:0:4:d906:4eb8:d33e:290f]) by pyroxene2a.sentex.ca (8.16.1/8.15.2) with ESMTPS id 27N9iuY4090141 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 23 Aug 2022 05:44:56 -0400 (EDT) (envelope-from mike@sentex.net) Message-ID: <829efc01-634d-c9ae-f1e1-4e8213c0cf5e@sentex.net> Date: Tue, 23 Aug 2022 05:44:56 -0400 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 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: Problems betwwen pf in FreeBSD 13 and WireGuard Content-Language: en-US To: =?UTF-8?Q?Carlos_L=c3=b3pez_Mart=c3=adnez?= , questions@freebsd.org References: From: mike tancsa In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 64.7.153.18 X-Rspamd-Queue-Id: 4MBkq35Vctz3pjQ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mike@sentex.net designates 2607:f3e0:0:1::12 as permitted sender) smtp.mailfrom=mike@sentex.net X-Spamd-Result: default: False [-3.40 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+ip6:2607:f3e0::/32]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[199.212.134.19:received]; ASN(0.00)[asn:11647, ipnet:2607:f3e0::/32, country:CA]; FREEMAIL_TO(0.00)[outlook.com,freebsd.org]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[mike]; RCPT_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[sentex.net]; ARC_NA(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 8/23/2022 2:16 AM, Carlos López Martínez wrote: > set skip on { lo wg0 } I would avoid the skip part as it often leads to unexpected troubles. Instead, add rules to allow traffic on those interfaces as you would expect.  If I would have to guess, there is no state rule on traffic egressing the wg0 interface to your internal network and hence gets dropped. > # Allow ICMP requests to check default route > pass out on egress inet proto icmp from (self) icmp-type echoreq label > "Allow ICMP requests for public interface" > Dont think its releated, but "self" is often not dynamically updated as interfaces come and go and IP addresses added / deleted I find.  If you can, hook in up/down events on wg0 to reload the pf rules. Or for now, after your wg interface is up, pfctl -f /etc/pf.conf to reload the ruleset so that the self table is updated.   Also, where do you add the IPs to your tables ? Instead of tables, try and use macros while you are debugging the rulesets. I also find helpful when debugging is to use  pfctl -sr and  pfctl -sr -v (to show rule numbers that match /var/log/pflog) that way you see how the macros are expanding as it sometimes doesnt parse the way you expect.     ---Mike