From owner-freebsd-net@freebsd.org Mon Sep 21 00:35:50 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB3563E00C1 for ; Mon, 21 Sep 2020 00:35:50 +0000 (UTC) (envelope-from SRS0=hkk9=C6=mail.sermon-archive.info=doug@sermon-archive.info) Received: from mail.sermon-archive.info (sermon-archive.info [71.177.216.148]) by mx1.freebsd.org (Postfix) with ESMTP id 4Bvlps6HQyz4ltD for ; Mon, 21 Sep 2020 00:35:49 +0000 (UTC) (envelope-from SRS0=hkk9=C6=mail.sermon-archive.info=doug@sermon-archive.info) Received: from [10.0.1.251] (mini [10.0.1.251]) by mail.sermon-archive.info (Postfix) with ESMTPSA id 4Bvlpk4fwKz2fjWY; Sun, 20 Sep 2020 17:35:42 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Subject: Re: sshd on two fibs From: Doug Hardie In-Reply-To: <48e3aa5d-3123-45f2-5c46-6851ad90110a@gjunka.com> Date: Sun, 20 Sep 2020 17:35:42 -0700 Cc: freebsd-net@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4D284B7B-F894-46EF-997E-2446117585B7@mail.sermon-archive.info> References: <48e3aa5d-3123-45f2-5c46-6851ad90110a@gjunka.com> To: Grzegorz Junka X-Mailer: Apple Mail (2.3445.104.15) X-Virus-Scanned: clamav-milter 0.101.4 at mail X-Virus-Status: Clean X-Rspamd-Queue-Id: 4Bvlps6HQyz4ltD X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of SRS0=hkk9=C6=mail.sermon-archive.info=doug@sermon-archive.info designates 71.177.216.148 as permitted sender) smtp.mailfrom=SRS0=hkk9=C6=mail.sermon-archive.info=doug@sermon-archive.info X-Spamd-Result: default: False [-1.84 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.991]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:71.177.216.148]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[lafn.org: no valid DMARC record]; NEURAL_HAM_LONG(-1.02)[-1.018]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.44)[-0.435]; RCPT_COUNT_TWO(0.00)[2]; FORGED_SENDER(0.30)[bc979@lafn.org,SRS0=hkk9=C6=mail.sermon-archive.info=doug@sermon-archive.info]; RCVD_NO_TLS_LAST(0.10)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:5650, ipnet:71.177.216.0/23, country:US]; FROM_NEQ_ENVFROM(0.00)[bc979@lafn.org,SRS0=hkk9=C6=mail.sermon-archive.info=doug@sermon-archive.info]; MAILMAN_DEST(0.00)[freebsd-net] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2020 00:35:51 -0000 > On 20 September 2020, at 16:20, Grzegorz Junka = wrote: >=20 > I have two WANs and a server with two interfaces, each interface = reaching different WAN. The server is configured with two routing = tables, fib0 and fib1, one per the corresponding interface. >=20 > I would like sshd to listen on both interfaces but on different fibs, = so that returning packets are sent to the proper gateway. Can I do it = with one sshd? Do I need to run two separate sshd's? Can I run two = separate sshd's on the same box? I have sshd running on two interfaces by using pf to handle the = situation. /etc/rc.conf contains=20 sshd_enable=3D"YES"=20 pf.conf contains ext_if =3D "em0"=20 back_if =3D "em1"=20 set skip on lo0=20 SSH =3D "nn"=20 pass in all=20 pass out all pass in log on $back_if proto tcp from any to any port $SSH =09 pass in log on $back_if reply-to ($back_if 192.168.1.254) proto = tcp from any to any port $SSH keep state=20 where: nn is the non-standard port I use for ssh 192.168.1.254 is the router for the second interface. I don't use fibs at all for this, although I do have them setup for when = I want to check out the second port connections. -- Doug