2

I have a wifi scanner which shows me the MAC addresses of the wifi routers nearby.

It displays SSIDs in one column and MAC addresses in another column.

I want to know the IP address of the router. What should I do?

2 Answers 2

3

WLAN is in the OSI-Model at layer 2 while IP is at layer 3. You need to first have full access to the layer 2 before you can get the information from layer 3. This means that for a WLAN without encryption you can probably see the information by using wireshark, but for a WLAN with encryption you need to decrypt the data first because the encryption is at layer 2. According to the documentation wireshark is able to decrypt WEP and WPA/WPA2 traffic in pre-shared mode if the passphrase is known.

2
  • 2
    Moreover (this may sound obvious but I'm not in the OP head...) a router has several IP addresses. While using Wireshark in the proper condition would show (one of) the router IP address(es) on the local network side, it will not show the address on the Internet side, ie. the router will not be reachable from the Internet using this address. Oct 24, 2015 at 9:59
  • 1
    One more thing to keep in mind is that WiFi isolation may actually prevent you from seeing most traffic in the first place. ARP requests should still show up, though, since those have to be universally broadcast. Oct 24, 2015 at 10:01
-1

There is no universal way to do this, and if you simply have a Wifi scanner, you really can't do much beyond what it gives you.

From here, my answer has to depend on the purpose of why you are trying to find this out.

If your goal is penetration testing, your focus should be on the encryption. If you can't get through the encryption, the IP addresses aren't going to help you (nor will they even be visible to you). SSID and MAC are both unencrypted, which is why you can easily see them on your scanner.

In most other cases - all that I can think of - the answer will be "ask whoever operates the WiFi router".

The second problem is that there is no 1:1 relationship between IP address and MAC address. Even if there is no encryption involved, the router's Mac address would be used by the router's IP address, but also by all IP addresses behind the router. The bridging between the wired and wireless parts of such a router adds yet more complications.

Also, you don't even necessarily know if the device has an IP address at all - it may be using a different protocol (although non-IP protocols are rare nowadays, you may only be thinking IPv4, while the device could conceivably have only an IPv6 address).

The only other thing you could try is to listen to the ARP protocol traffic.

4
  • This appears to avoid the question altogether. Sure, these might be useful caveats, but they don't address the question.
    – schroeder
    May 21, 2023 at 11:52
  • @schroeder I find this comment surprising, especially after almost eight years. This answer says exactly the same thing as the accepted answer: "you have to have full access to layer 2" just phrased differently, and then elaborates on the fact that WiFi networks usually don't give you that full access. May 22, 2023 at 15:49
  • The question is "how?" Para3: "you need to get thru encryption". Great. How? Para4: "ask the operator". Kinda cheeky. Para5: some strange description of NAT that seems irrelevant. Para6: introduce a VERY strange corner case. Para7: "if you are joined to the network, you could listen to ARP" ... or simply look up the gateway in your IP settings... but if this was possible, the question would not have been asked. So this is stuff around and answer, but not actually an answer.
    – schroeder
    May 22, 2023 at 16:08
  • Time is irrelevant. You have an opportunity now to improve this answer greatly.
    – schroeder
    May 22, 2023 at 16:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .