2

I've got two routers that separate my computer from the internet, now I need to get the external IP of the second router to port-forward a connection through both routers to my computer. I tried it already with only one router and it worked, but I need both routers and so i need the external IP of the second one but i have no idea how to get it. My second router has a list with every connected device and its IP but unfortunately my first router doesn't have anything like that and I can't switch places of the routers. So how can I do it? As an extra-information: I've got a Windows 8 PC with a Linux Partition on it so any solution would be ok. Thank you for your efforts and sorry for my English.

router order: internet - router 1 - router 2 - computer, so I don't need the IP accessible from the internet.

1
  • What router is it? What does the manual say for that router?
    – Dave
    Feb 14, 2014 at 11:42

1 Answer 1

2

The easiest and most obvious way would be to check the configuration pages of router 2. Along with a list of connected devices by IP, you should be able to find its WAN IP, usually in a catagory called 'status' or 'internet settings'. Alternatively, and in no particular order:

  • Telnet or SSH into router 2 and check the IP configuration with ifconfig. Not all routers support this.
  • More advanced, telnet or SSH into router 1 and check its DHCP leases, for example in /tmp/dnsmasq.leases. Again, not all routers support this and if yours does, chances are it has the same information readily available through its web pages.
  • Use a machine connected between router 1 and router 2, and ping router 2 by its hostname. The name will resolve to an IP address. This of course assumes that both you and router 1 know its hostname and that the DNS is cooperative.
  • Use the same machine and run the command arp -a, which to my knowledge works on all major OSes. This gives a list of hosts connected on your subnet, although it is not necessarily complete. Exclude the addresses you know to be other devices and try whatever remains. You could also compare the MAC-addresses from the list with the one printed on the back of router 2 or the one found in its configuration pages.
  • Again from the same subnet, install a packet sniffer. Traffic to and from the subnet behind router 2 will have the IP you're looking for as destination or source address. If you can't make sense of any of the entries, something specific to look for is the DHCP request and response that appears when you renew the lease on router 2, or, more hands on, power it off and on.
  • Get a router that shows a proper list of clients already.
1
  • Thanks man, I didn't check that and indeed it worked! I've been searching for a solution so long and i didn't think it'd be so easy :-)
    – user300119
    Feb 14, 2014 at 15:08

You must log in to answer this question.