From nobody Fri Dec 01 04:20:21 2023 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 4ShKbz1fLJz53F9J for ; Fri, 1 Dec 2023 04:20:31 +0000 (UTC) (envelope-from Olivier.Nicole@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ShKbw3Z7nz3Qsm for ; Fri, 1 Dec 2023 04:20:27 +0000 (UTC) (envelope-from Olivier.Nicole@cs.ait.ac.th) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cs.ait.ac.th header.s=selector1 header.b="Z 8F/A5H"; spf=pass (mx1.freebsd.org: domain of Olivier.Nicole@cs.ait.ac.th designates 192.41.170.16 as permitted sender) smtp.mailfrom=Olivier.Nicole@cs.ait.ac.th; dmarc=pass (policy=none) header.from=cs.ait.ac.th Received: from mail.cs.ait.ac.th (localhost [127.0.0.1]) by mail.cs.ait.ac.th (Postfix) with ESMTP id 2AC6D3AB04; Fri, 1 Dec 2023 11:20:23 +0700 (+07) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cs.ait.ac.th; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:in-reply-to:subject:subject:from:from :received:received:received; s=selector1; t=1701404423; x= 1703218824; bh=exW8MkXzz7+39/X4juHADYVfx0oaX5SxmoMZ/HrCVCI=; b=Z 8F/A5Ha1NMKeFVXIcwp1h41Zi/SwcYMGhz5qON3JA3KhY25REqCVrbt6Af0zXwOy z+TrtFwK599xQ8FqV83Pt2pAVfd0t+Hbe1FxwKAjsZEt1hB0xjRG0tU3zV+bcZhV oFCWWPgDNca2aKWBXHUVHPR1LFU/pYe4Q7bc66gd6o= X-Virus-Scanned: amavisd-new at cs.ait.ac.th Received: from mail.cs.ait.ac.th ([127.0.0.1]) by mail.cs.ait.ac.th (mail.cs.ait.ac.th [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id g7luwuXrPTzB; Fri, 1 Dec 2023 11:20:23 +0700 (+07) Received: from banyan.cs.ait.ac.th (banyan.cs.ait.ac.th [192.41.170.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.cs.ait.ac.th (Postfix) with ESMTPS id E65973AB02; Fri, 1 Dec 2023 11:20:22 +0700 (+07) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.15.2/8.15.2/Submit) id 3B14KMGP003213; Fri, 1 Dec 2023 11:20:22 +0700 (ICT) (envelope-from on@banyan.cs.ait.ac.th) From: Olivier To: Paul Procacci Cc: questions@freebsd.org Subject: Re: tap interface forcing a permanent ARP association In-Reply-To: (message from Paul Procacci on Thu, 30 Nov 2023 01:30:04 -0500) Date: Fri, 01 Dec 2023 11:20:21 +0700 Message-ID: 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-4.70 / 15.00]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DMARC_POLICY_ALLOW(-0.50)[cs.ait.ac.th,none]; R_SPF_ALLOW(-0.20)[+mx]; R_DKIM_ALLOW(-0.20)[cs.ait.ac.th:s=selector1]; RCVD_IN_DNSWL_MED(-0.20)[192.41.170.16:from]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[cs.ait.ac.th:+]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; FREEMAIL_TO(0.00)[gmail.com]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; ASN(0.00)[asn:4767, ipnet:192.41.170.0/24, country:TH] X-Rspamd-Queue-Id: 4ShKbw3Z7nz3Qsm X-Spamd-Bar: ---- The plot thickens... Paul Procacci writes: > [1:text/plain Show] > > > [2:text/html Hide Save:noname (7kB)] > > On Wed, Nov 29, 2023 at 10:35=E2=80=AFPM Olivier > wrote: > > Hi, > > I have an OpenVPN server running on FreeBSD (13.2-p5). I have included > the following in /etc/rc.conf: > > cloned_interfaces=3D"tap0 bridge0" > ifconfig_bridge0=3D"addm vmx0 addm tap0" > ifconfig_tap0=3D"UP" > openvpn_enable=3D"YES" > > And it works fine, except that ip maps the MAC address of tap0 to the IP > of my web server (on another machine), and the mapping is > "permament": > > www.cs.ait.ac.th (10.41.170.42) at aa:bb:cc:dd:ee:ff on tap0 permanent > [ethernet] > > That has two adverse effects: > - any VPN client cannot access my web server as they would get a wrong > MAC address; > - the VPN server will sometime reply to an ARP request on my LAN, > providing an obviously wrong answer. > > Poking around, I found out that it was due to the "ifconfig_tap0=3DUP" > line. Further more, that line is not needed for OpenVPN to start > properly; so I have disabled it. > > But I would like to understand why turning up the tap interface causes > it to update the ARP table. > > Best regards, > > Olivier > > --=20 > > If I'm being honest, what you're saying sounds really strange. > NIC vendors have prefixes assigned to them for their MAC usage and the > chances of collision between two machines especially since the local nic = in > question is a tap is an absolute fat 0 chance. > -- That is, unless somewhere someone is doing something they shouldn't, or > perhaps the entire picture wasn't provided and information is missing. I have checked that the hostuuid are different and that the MAC addresses on both machines are different. I have conducted some more tests on a machine that has been created from scratch, still FreeBSD RELEASE-13.2-p5 $ ifconfig tap0 create $ ifconfig tap0 UP ifconfig: WARNING: setting interface address without mask is deprecated, default mask may not be correct. $ ifconfig tap0 tap0: flags=3D8843 metric 0 mtu 1500 options=3D80000 ether 58:9c:fc:10:a4:65 inet 192.41.170.42 netmask 0xffffff00 broadcast 192.41.170.255 groups: tap media: Ethernet autoselect status: no carrier nd6 options=3D29 Does mofidy the ARP table and associates the IP of my web server to the MAC of the interface tap0: $ arp -a | grep 192.41.170.42 www.cs.ait.ac.th (192.41.170.42) at 58:9c:fc:10:a4:65 on tap0 permanent [et= hernet] While: $ ifconfig tap0 create $ ifconfig tap0 up $ ifconfig tap0 tap0: flags=3D8803 metric 0 mtu 1500 options=3D80000 ether 58:9c:fc:10:a4:65 groups: tap media: Ethernet autoselect status: no carrier nd6 options=3D29 Doesn't: $ arp -a | grep 192.41.170.42 $ Any idea is welcome. Best regards, Olivier