

Mapping network devices also requires an understanding of IP address allocation. Operating systems such as Windows, Linux, and macOS have their own set of networking commands such as "ipconfig" and “ping” for basic scanning and troubleshooting. Note that this information will be of no use to you: You can only use one default route, and you can't use different gateways into the internet to somehow get faster speeds etc.How to manually identify unknown devices on a networkĪ simple way to identify an "unknown device on a network" is through the command-line interface (CLI) of your computer system. So if your situation is not that you are part of a corporate network with different next hops in each segment on each interface, but you are accidentally connected to three standard home networks, where no one has bothered to set up the right infrastructure for such a case, and you want to know the announced gateway in the DHCP answers, you can (1) look in the logs for DHCP answers, (2) disconnect all three interfaces, re-connect each in turn, get a new DHCP answer and write down the default route, (3) use a tool to debug DHCP requests, so you can send out an additional one. Note that there is no "default interface". If you are connected to three LAN segments, each with their own DHCP server, and each with a connection to the internet via a gatway (which shouldn't happen in a professionally designed network), then the host will receive three DHCP answers with different gateways, will set the default route each time, and the last wins.

The typical reaction to this gateway address announcement is that the host sets the default route to this address. your home router) then answers "Welcome, use this IP address, and by the way, if you want to reach the internet from this segment, please use this gateway address as next hop." ("Hello, I'm new here, what IP address should I use?"). When a host connects to a LAN segment, and can send out a DHCP broadcast to acquire an IP address. Just in case, a short reminder of what happens behind the scenes: You can also use ip route get 1.2.3.4 to see to which next hop a packet with this final destination will be sent. All routes that have next hops in the address range of some interface will be "gateway" candidates. If you don't know the address ranges, use ip addr to see them. So use ip route to see your routing table. (Actually, the routing algorithm just wants to know where to send a particular packet (next hop), it doesn't care if the next hop is something you'd call a "gateway", or just a normal host).
