-3

I have a router connected directly to my pc and I misconfigured my router's ip address and had disabled dhcp on it prior and popped off the reset button(so resetting is not possible).Due to this, I'm considering pinging all possible ip's till it responds. My question is this:

  1. Suppose my router has a different network id(eg. my ip is 192.168.1.1/24 and the router's ip is 192.168.0.1, will it respond to a ping in that case if the 2 are directly connected?
  2. IF not does this mean I need to keep changing my ip address to ping all possible network id's. Very new to networking please help.

4 Answers4

3

Turn the router off. Connect one of the router's LAN ports to the PC and ensure nothing else is connected to either the PC or the router. Run any packet capturing software on the PC that you like.

Turn the router on. Watch for captured packets. You will eventually see the router try to do something, typically within a few minutes. From those captured packets, you can see the source IP address, which will be the LAN address assigned to the router.

David Schwartz
  • 31,449
  • 2
  • 55
  • 84
0

As you disabled DHCP on the router, your PC won't get IP from it. You have to set a static network configuration on your PC. For example on Linux:

Address = 192.168.0.2/24   # Assign copmuter's IP and 255.255.255.0 netmask
Gateway = 192.168.0.1      # Router's IP. If it's different you will change above mentioned settings accordingly

On other OS's (Windows, Mac etc) it's the same. Static net configuration.

Ahmed
  • 11
  • 4
0
  1. No, if you router has an IP of 192.168.1.1/24, you should have an IP 192.168.1.x/24 to make connection possible

  2. So the method would be to guess the subnet, let say try these on your computer:

192.168.1.5/24

192.168.0.5/24

etc.

Run ip scanner each time. On Linux

sudo apt-get install nmap
nmap -sP 192.168.1.*

On Windows:

http://www.angryip.org

You can also use this command in command line:

arp -a

Use packet sniffers. On Linux, it's just tcpdump, on Windows, it's Wireshark - https://www.wireshark.org

Also few hints:

  • Maybe you can find router's IP in browser's history?

  • You can check default IP address or at least subnet on router's documentation so it may narrow down your search

  • Most common subnets are: 192.168.0.0/24 , 192.168.1.0/24 , 192.168.2.0/24 , 192.168.0.0/24 , 10.0.0.0/24

laimison
  • 579
  • 2
  • 9
  • 17
0

If your router is still doing DHCP, this is pretty easy! Just open a shell and view the route table on your local system:

  • For Linux: ip route
  • For Windows: route print

The output will be somewhat like this:

default via 192.168.0.1 dev wlan0 proto dhcp metric 600 
192.168.0.1/24 dev wlan0 proto kernel scope link src 192.168.0.1 metric 600 

The very first entry in the table will very likely be your router.

nbailey
  • 171
  • 6