LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Discovering IP address (https://www.linuxquestions.org/questions/linux-general-1/discovering-ip-address-620819/)

XavierOnassis 02-13-2008 08:05 AM

Discovering IP address
 
I have a WRT54GL set up as a wireless bridge (with DD-WRT) to a WRTP 54G plugged into a four port SMC firewall/router.

I know the IP of both the SMC and the WRTP54G but I cannot remember the IP address of the wireless bridge.

Nothing I've tried (or can think of.. arp -n, tracert, etc) has revealed the IP address for this router.
What can I do to discover it's IP address?

b0uncer 02-13-2008 08:08 AM

If you know in what subnet it is in, you could (with a script maybe) try trough all the IPs - about two and a half hundred at maximum. Probably you'll hit the address sooner; if the address wasn't set completely randomly, try starting at the beginning and the end of the address space.

And if you are connected and send packets trough all the devices and trace their route, shouldn't that reveal the IP or am I missing something?

makuyl 02-13-2008 09:02 AM

Go to the WRTP54G via browser, probably 192.168.1.1 and check the connected clients status page. Should reveal the WRT54GL.
If you're connected through wifi, just do: traceroute www.google.com

XavierOnassis 02-13-2008 09:24 AM

Quote:

Originally Posted by b0uncer (Post 3055640)
If you know in what subnet it is in, you could (with a script maybe) try trough all the IPs - about two and a half hundred at maximum. Probably you'll hit the address sooner; if the address wasn't set completely randomly, try starting at the beginning and the end of the address space.

This is another point that's confusing me.
The first router's IP 192.168.15.1 with 249 addresses starting at 192.168.15.100. But I can access it using 192.168.15.1 or 192.168.2.14 (the SMC is 192.168.2.1)
The three machines on the bridge are 192.168.15.101, .102. and .103
So the bridge ought to be within the .100 to .249 range?


Quote:

And if you are connected and send packets trough all the devices and trace their route, shouldn't that reveal the IP or am I missing something?
That's what I thought but running traceroute against the router (which is of course, on the other side of the firewall) show it's IP as the first hop but doesn't show the firewall at all.

XavierOnassis 02-13-2008 09:31 AM

Quote:

Originally Posted by makuyl (Post 3055707)
Go to the WRTP54G via browser, probably 192.168.1.1 and check the connected clients status page. Should reveal the WRT54GL.
If you're connected through wifi, just do: traceroute www.google.com

Traceroute times out on the first hop:
1 * * *

the second hop is the address of the firewall then it ignores the first router then - out to the WAN.
The router is 192.168.15.1 and the SMC is 192.168.2.1 - I don't get why the first router isn't shown.

makuyl 02-13-2008 04:20 PM

If you have boxes connected to the wifi router a "route -n" on one of them should show the gateway.
Cut off power to one router at a time and see what route and ping gives you.

XavierOnassis 02-14-2008 07:14 AM

Quote:

Originally Posted by makuyl (Post 3056143)
If you have boxes connected to the wifi router a "route -n" on one of them should show the gateway.
Cut off power to one router at a time and see what route and ping gives you.

Yeah, it's showing the gateway - the first router - but not the bridge.

I've been meaning to get around to learning about bash scripting - this looks like a good time to do it.

I can't quite imagine what the script would do... ping each possible IP?

makuyl 02-14-2008 02:07 PM

Ping should do it unless you've dropped icmp on the bridge.
Might be as easy to just reset the device to factory settings which should set it to 192.168.1.1. Should have a microswitch in a hole somewhere. You would of course have to set it up again.
Why not just connect only the bridge to your box and nmap or ping an IP range to find it, or can't you lose the wifi momentarily for that?
If you disconnect the router-bridge wire, "route -n" on a connected box should show it as gateway, not the router.

EDIT: No need to write a script unless you want to, plenty on google like this one:
http://larsen-family.us/bash_scripts...ipts.html#scan

farslayer 02-14-2008 03:24 PM

Don't re-invent the wheel, Scan the subnet with a nmap Ping scan.

nmap -sPR 192.168.1.0/24

That should return all pingable hosts from 192.168.0.1-192.168.0.254, and resolve their names if possible.


All times are GMT -5. The time now is 08:52 PM.