How to recover a server stuck with a bad IP address ? (NSLU2)

0

I have a NSLU2 (debian server) that was configured for an old network, with a static IP address on Ethernet.

Now I've moved, and the server boots using the old IP address, so I can't access it when I connect it to my router with Ethernet, or even when I connect it to my PC via Ethernet.

I don't remember what was its old IP address, I tried 192.168.0.1/2/3/4 and 192.168.1.1/2/3/4 but no response to the ping (I'm pretty sure the old address was in there).

How can I change the IP address, or ssh to it now ? The debian system is installed on a USB stick, is there a file that I can edit on my computer to make it start ok ?

Matthieu Napoli

Posted 2011-06-14T18:42:06.527

Reputation: 665

Answers

1

Load up wireshark and monitor the network until you see a packet coming from the server. Hopefully there is some service such as DNS or NTP that will trigger a network query. You can go through the packet list for any unknown IP addresses - that will probably be the server IP address.

Darth Android

Posted 2011-06-14T18:42:06.527

Reputation: 35 133

That is a great idea!! I tried that, but nothing else than my macbook's requests showed up. I think my NSLU2 is dead (or at least the USB stick with the system installed on it). I'll flash it. Thanks – Matthieu Napoli – 2011-06-14T19:34:49.920

2

If you can access the server directly, edit the file /etc/network/interfaces

A sample configuration for a static server is:
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254

If you want the IP addess set on the server, change the above to suit your needs.

If you want to switch over to DHCP, then change the configuration to read
auto eth0
iface eth0 inet dhcp

Chris Ting

Posted 2011-06-14T18:42:06.527

Reputation: 1 529

2

If you have another computer that can read the USB stick, then the IP address is probably set in /etc/network/interfaces. You will definitely need to change the address setting, and possibly the other settings as well, depending on how different your new network is. If you don't have some of these settings, don't worry, the absolute minimum is address and netmask for an interface with no gateway to the internet:

iface eth0 inet static
        address 192.168.1.4
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1

If you can read it but not edit it, set up a computer with a (different) static IP address in the same network with the same netmask and it should be able to ssh to the IP address shown in the file.

DerfK

Posted 2011-06-14T18:42:06.527

Reputation: 917

1

Try changing the IP address on your PC to a manual address that is in the correct range for the server. plug them both into the same switch and ssh away. once you have it set, switch your PC back yo DHCP.

uSlackr

Posted 2011-06-14T18:42:06.527

Reputation: 8 755

That's exactly what I did (I tried 192.168.0.50 and 192.168.1.50) but no response at all (see my question). – Matthieu Napoli – 2011-06-14T18:56:50.903

Do you have nmap on your mac? You could do a ping scan of the network to see what all addresses respond. – uSlackr – 2011-06-15T02:46:55.903

Thanks, I've finally managed to find it, I had to do a full reset but now it show up on the network. But I didn't know nmap thanks. – Matthieu Napoli – 2011-06-15T07:10:12.737