Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Dec 2018 17:14:25 -0500
From:      Ernie Luzar <luzar722@gmail.com>
To:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   sh code to determine if host is on lan 
Message-ID:  <5C099F41.2020407@gmail.com>

next in thread | raw e-mail | index | archive | help
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.

Is this the only way to determine if the host is on a lan?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5C099F41.2020407>