Find out my gateway ips?

hi,
i want to know how can i get my gateway ips in the network,what i want is the ip of my neighbors in subnet( computers that are directly connected to my computer via lan or wlan), how can i get these information?
thanks in advance.

Neighbors don't exactly advertise themselves.

On a local network, you can use tons of ARP who-has packets to scan the entire subnet range. Anything with an IP answers to ARP.

On a WAN you're stuck with ping, and things don't have to answer that.

login to their router or a computer on their network and check it. or ask him.