TransWikia.com

How to know on which LAN a machine is connected?

Unix & Linux Asked by jpc on December 29, 2020

I have two LANs (192.168.1.0/24 and 192.168.2.0/24) linked by VPN.
I have one machine (RPI3b+) that I can be connected on the first or the second LAN (I move it).

How can I know where is the machine or, rather, how the machine can know where it is ?
Each LAN has a router.

I cannot use ping because ping "see" the second LAN through the VPN.
I note that the ARP table cumulates the both LAN.

I tried:

ip -4 neighbor show

But the both LAN are shown (because of arp) !

Rgds,

Note 1: I don’t use DHCP, only static addressees

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP