From owner-freebsd-questions@freebsd.org Fri Dec 7 19:56:58 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 113F2131874F for ; Fri, 7 Dec 2018 19:56:58 +0000 (UTC) (envelope-from merlyn@geeks.org) Received: from mail.geeks.org (mail.geeks.org [IPv6:2001:4980:3333:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8606075081 for ; Fri, 7 Dec 2018 19:56:47 +0000 (UTC) (envelope-from merlyn@geeks.org) Received: from mail.geeks.org (localhost [127.0.0.1]) by after-clamsmtpd.geeks.org (Postfix) with ESMTP id 0D728110221; Fri, 7 Dec 2018 13:56:46 -0600 (CST) Received: by mail.geeks.org (Postfix, from userid 1003) id E499811021A; Fri, 7 Dec 2018 13:56:45 -0600 (CST) Date: Fri, 7 Dec 2018 13:56:45 -0600 From: Doug McIntyre To: Ernie Luzar Cc: freebsd-questions@freebsd.org Subject: Re: sh code to determine if host is on lan Message-ID: <20181207195645.GA64030@geeks.org> References: <5C099F41.2020407@gmail.com> <5C09AB7B.4010001@gmail.com> <20181207011905.af7d5c29.freebsd@edvax.de> <5C09C491.1060803@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5C09C491.1060803@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Virus-Scanned: ClamAV using ClamSMTP X-Rspamd-Queue-Id: 8606075081 X-Spamd-Result: default: False [2.84 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr]; NEURAL_SPAM_SHORT(0.85)[0.848,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[geeks.org]; NEURAL_SPAM_MEDIUM(0.73)[0.728,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[asg.geeks.org]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(0.83)[0.828,0]; IP_SCORE(0.75)[asn: 7753(3.82), country: US(-0.09)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:7753, ipnet:2001:4980::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2018 19:56:58 -0000 On Thu, Dec 06, 2018 at 07:53:37PM -0500, Ernie Luzar wrote: > Polytropon wrote: > > elOn Thu, 06 Dec 2018 16:06:35 -0700, JD wrote: > >> > >> On 12/06/2018 03:14 PM, Ernie Luzar wrote: > >>> Hello list > >>> > >>> Know that "route -n get default" will give me the nic name of the > >>> interface connected upstream. That "ifconfig nic" will give me the ip > >>> address. That if that ip address is one of these ranges > >>> 192.168/16 or 172.16/12 or 10/8 then the host is on a lan. Hmm, I thought my host here was on a LAN.. vmx0: flags=8843 metric 0 mtu 1500 inet 216.250.176.100 netmask 0xffffffe0 broadcast 216.250.176.127 inet6 2001:4980:2:dad::100 prefixlen 64 And this one too.. bce0: flags=8843 metric 0 mtu 1500 inet6 2001:4980:0:1000:21e:c9ff:feb5:663a prefixlen 64 autoconf inet6 2001:4980:0:ffff:21e:c9ff:feb5:663a prefixlen 64 autoconf Are you sure your definition of "LAN" is the correct term? What is it you are trying to determine?