You are not logged in.

#1 2010-02-08 23:28:42

Ferrenrock
Member
Registered: 2008-11-22
Posts: 36

[SOLVED] Finding the IP of a device

Alright, so I installed arch on a computer and set sshd to run in the background. At the moment, the computer doesn't have a monitor, and the other computer in my room is a laptop (so no screen switching). I want to be able to log into the monitorless computer via ssh.

Anyway, both computers have a wired ethernet connection to a switch in my room (which is needed to get any connection at all by my university). They both get a dhcp-leased IP that is NOT on a subnet, meaning every device shows up as an independent IP when queried.

So, my question is this: is there a way I can figure out the IP of the monitorless server running ssh, so I can log into it? I know the hostname, if that helps.

Last edited by Ferrenrock (2010-02-10 13:09:23)

Offline

#2 2010-02-08 23:52:38

raf_kig
Member
Registered: 2008-11-28
Posts: 143

Re: [SOLVED] Finding the IP of a device

Well, first thing to try is whether there is some (dhcp-magic based) dns working - try nslookup hostname / ping hostname and see if that yields any results.

They both get a dhcp-leased IP that is NOT on a subnet, meaning every device shows up as an independent IP when queried.

I don't really get what you are trying to say here. Why should they get the same ip? And what does that have to do with subnets?

Can you paste
1) Your laptop's IP address
2) the output of route -n

Regards,

raf

Offline

#3 2010-02-09 10:58:48

fumbles
Member
Registered: 2006-12-22
Posts: 246

Re: [SOLVED] Finding the IP of a device

Is that a configurable switch? Or is it a hub? You have many options if this is the case. However if it's a standard non configurable network switch, then ...

Statically assign your laptop as say: 192.168.200.2/30

As for your computer, you will need to have two ip addresses.

eth0.0 => 192.168.200.1/30
eth0.1 => DHCP FROM UNI

And then bridge to two so the laptop can have access.

I have only done this in the networks side of things. But a quick google came up with: http://www.xenocafe.com/tutorials/linux … /index.php

[edit] /30 is the same as a subnet mask of 255.255.255.252

Last edited by fumbles (2010-02-09 11:02:41)

Offline

#4 2010-02-09 12:14:47

mdickinson
Member
Registered: 2006-10-08
Posts: 5

Re: [SOLVED] Finding the IP of a device

If you've got two machines connected to a dumb switch jacked into an outlet in your dorm then both machines are probably on the same subnet. 

Disconnect your switch from the university. 
Disconnect anything else from the switch so that the only things connected are the arch box and the laptop.
Use something like fping/nmap to scan the subnet DHCP is assigning from.

The IP that responds is your arch box.  Log in and setup a serial console, dyndns, or something like fumbles suggested.

Or you could setup a DHCP server on the laptop and serve the arch box whatever IP you want it to have, just don't do that while connected to the university's network.

Offline

#5 2010-02-10 10:09:13

Ferrenrock
Member
Registered: 2008-11-22
Posts: 36

Re: [SOLVED] Finding the IP of a device

Sorry about the wait--I took mdickinson's advice and did a ping sweep with the cord unplugged. Originally, I had done it for all 255 addresses in the subnet and it had been impossible to figure out anything.

raf_king, fumbles: My wording was awful, partially due to the fact that half of what I said was wrong: what I meant to say was that every IP is a <b>public</b> IP (and not behind any sort of NAT), and while the switch in my dorm room might physically be a subnet of its own, address-wise the fourth octet corresponds to a subnet consisting of multiple rooms. Perhaps this will explain it:

[root@xaiwos ~]# ifconfig eth0 | grep inet
          inet addr:130.126.66.100  Bcast:130.126.67.255  Mask:255.255.254.0

[root@xaiwos ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
130.126.66.0    0.0.0.0         255.255.254.0   U     202    0        0 eth0
0.0.0.0         130.126.66.1    0.0.0.0         UG    202    0        0 eth0

[root@xaiwos sampo]# nmap -sP 130.126.66.1-255
Starting Nmap 5.21 ( http://nmap.org ) at 2010-02-10 05:56 CST
Nmap scan report for uiuc-tri-net.gw.uiuc.edu (130.126.66.1)
Host is up (0.0017s latency).
MAC Address: 00:15:C7:24:7C:00 (Cisco Systems)
.......(blah blah blah 20 IPS)........
Nmap scan report for tri0752.urh.uiuc.edu (130.126.66.100) <--my laptop
Host is up.
Nmap scan report for tri0764.urh.uiuc.edu (130.126.66.112) <--my xbox
Host is up (0.00010s latency).
MAC Address: 00:22:48:77:74:AA (Microsoft)
.....(one hundred more IPs).....

But when I unplugged the switch from everything else, I got

[root@xaiwos sampo]# nmap -sP 130.126.66.1-255

Starting Nmap 5.21 ( http://nmap.org ) at 2010-02-10 06:25 CST
Nmap scan report for 130.126.66.100
Host is up.
Nmap scan report for 130.126.66.112
Host is up (0.00010s latency).
MAC Address: 00:22:48:77:74:AA (Microsoft)
Nmap scan report for 130.126.66.150
Host is up (0.00013s latency).
MAC Address: 00:E0:4C:39:9B:08 (Realtek Semiconductor)
Nmap done: 255 IP addresses (3 hosts up) scanned in 29.16 seconds

After that, the answer was pretty clear which one was the mystery computer.
And now I just remembered that I forgot to change the hosts.allow file on that other computer....crap....

Offline

#6 2010-02-10 11:43:17

raf_kig
Member
Registered: 2008-11-28
Posts: 143

Re: [SOLVED] Finding the IP of a device

You might mark the thread as solved,

Regards

raf

Offline

#7 2010-02-10 13:11:19

Ferrenrock
Member
Registered: 2008-11-22
Posts: 36

Re: [SOLVED] Finding the IP of a device

Thanks raf, I was looking for a "solved" button for 5 minutes before I realized I just had to change the title.

Aren't I a couple of watts short....

Offline

Board footer

Powered by FluxBB