0

Sorry if my question is not very clear, I'm new at this. I'm connected to a router that is then connected to an AP. They both use NAT. Is there any way I can programmatically determine the local IP address that the AP has assigned to the router? I know the DHCP range and the local IP address of the AP, but I don't have access to the configuration of neither the router or the AP. Any language would do, but I'd prefer Java or C#. Thanks in advance.

Please don't mark as duplicate. I don't want to know my public IP address, the address I want is in a local network.

Erlan91D
  • 1
  • 1
  • You mean like tracert command output? – Cleptus Jun 05 '18 at 15:16
  • I tried tracert, but all I get is the IP of the AP and not the one it assigns to the router. Maybe I'm not using it right. Could you tell me what parameters should I use? – Erlan91D Jun 06 '18 at 05:20
  • If I get it right `pc--(network1)--router--(network2_dhcp)--AP` and you want to know the IP the AP gave via DHCP to the router. Without access to none of the devices in network2 and programatically... You cannot. In plain words, routers are made to separate, isolate networks. – Cleptus Jun 06 '18 at 07:22
  • That's exactly what I want. I thought maybe there was a way to connect to a service on the AP and then see what IP address you had realative to the AP. If I understand NAT correctly, when I make a request to a service in the AP, it looks as if the request was made by the router. – Erlan91D Jun 06 '18 at 14:05
  • The NAT table is always a router (in your case the AP) internal table, otherwise it would leak sensitive information (internal infraestructure) to the internet. Without access to the AP you could not check the NAT table. If there were a service it would most probably be vendor specific. Edit: The purpose of NAT is to hide that info – Cleptus Jun 06 '18 at 14:55
  • I guess I'm asking too much then. Thank you. – Erlan91D Jun 09 '18 at 20:16

1 Answers1

0

If the access point is the main "gateway" NAT router on your network:

  1. Start > Run > type: cmd (to enter command prompt)
  2. Type: ipconfig /all
  3. In the list, find the line that is your "Default Gateway", this is your primary router/access point.

f the above does not work, or you have multiple access points and you are not connected to the main router, you can try the following solution:

  1. Find the MAC address of your access point (it is usually printed on its label).
  2. Ping your network address (substitute your client IP's last number with .255, i.e. if your IP is 192.168.1.23, type: ping 192.168.1.255)
  3. Type: arp -a (look for the MAC address of your access point, and note its IP address)

Note: If a secondary AP is not in the ARP list of interfaces, you can also find its assigned IP by logging in to the main NAT router, and looking for it at the LAN wired clients list.

  • As I say in the question, I don't have access to the router or the AP. I am simply connected to the router (wireless). I just need to figure out a way to determine the local IP address that the main AP asigns through DHCP to the router I'm connected to, in order to know what IP shows up in the AP when I make an http request. – Erlan91D Jun 06 '18 at 05:11
  • no that only gives you the gateway address, it is hardly ever the AP you are connected to. if you have 4 APs and a 48port switch in your home like I do, then you still won't know which is which using tracert. – hamish Mar 29 '20 at 22:51