You are not logged in.
Hello
I would like to find a way to list all computers on the local network and their IP addresses.
Is there any application which could do this?
Thanks
// Lasse
Offline
Use:
$ for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ; doneOffline
Your best bet is to look at the gateway and check the logs. Otherwise there is no sure fire method of finding everyone.
Offline
Hmm... n0dix, that one won't work, I don't use a router, just a switch, the computer IP addresses are assigned from my ISP. But I think there should be some way to do it, how does stuff like samba and network games find local network computers otherwise?
Last edited by Lazze (2010-03-19 12:39:36)
Offline
nmap -sP 192.168.1.*Obviously change the actual ip to what you want it to scan.
Last edited by lifeafter2am (2010-03-19 13:03:25)
#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.
Offline
Hmm... n0dix, that one won't work, I don't use a router, just a switch, the computer IP addresses are assigned from my ISP.
That means you don't have a LAN. Theoretically you'd need to check the whole internet to find out what your hostnames are.
Can't you use a service like DynDNS to link the IPs to a hostname? I do it all the time with the systems I maintain.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
The problem is that I have no idea what the IP is. If I give a bit of background to my issue, it might clarify my issue a bit:
I have an arch server running in my old apartment, which is in another city. The server has no display and no keyboard attached to it. It was running fine until a few days ago when it stopped responding on ssh, web, ftp etc.. I guess my IP address changed or the power went off. I don't have a static IP but my dynamic IP doesn't normally change if the computer isn't turned off.
Since I'm not going to my apartment for a couple of weeks and it's quite far way I was thinking of asking a friend to go their and make sure it's turned on. But if it is off the IP address probably wont be the same when turning it on. Since my friend isn't much of a computer guy I thought he could bring his laptop and connect it to my LAN and list the computers and their IP addresses and give the list to me. He has ubuntu on his computer...
I don't care much how to get the IP as long as it's simple enough for my friend.
Thanks for the help so far!
// Lasse
Offline
If the hosts has IPv6 you can use
ping6 ff02::1%eth0This won't help you get their IPv4-addresses though.
You could also try
nmap --ttl 1 -sP 192.168.0.0/24where 192.168.0.0/24 should be your network number and subnet mask.
Offline
.:B:. There must be a LAN, otherwise using samba and stuff like that wouldn't automatically display my other computers in my apartment.
Offline
You could check with your ISP, but then again I don't know if they can tell your reliably what IP addresses they gave out to you...
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
I've sent a mail to my ISP, waiting for a reply, but I'm quite sure they wont tell my which IP addresses currently using my connection.
Offline
I'd be careful as a lot of consumer ISPs prohibit running services on your machines. Not sure if sshd would qualify.
And you really should be using dyndns or something with an automatic updater on the machine for this.
[git] | [AURpkgs] | [arch-games]
Offline
I'm using an .net domain which should update automatically but it hasn't, maybe my computer is turned off due to power loss and if I'm lucky when my friend turns it on it will update the DNS automatically otherwise it probably stopped working or isn't turned on.
Swedish ISPs don't care too much if you have a lot of services running. My ISP even provides static IP addresses for a small fee, about $3 a month. Maybe it's time to get one by now...
Last edited by Lazze (2010-03-19 14:40:15)
Offline
I like arp-scan, gives ip and mac address
arp-scan: A tool that uses ARP to discover and fingerprint IP hosts on the local network.
It's in AUR.
Offline
Thanks, I'll try it out.
Offline
There seems to be a bit of confusion in this thread. Presumably you want the external IP so that you can connect to the computer once it's up again, but your question (and thus many of the replies) concerns the internal (LAN) IP address.
If you have a LAN, then your friend will only see the internal IP address if he scans it (using e.g. "nmap -sP xxx.xxx.xxx.xxx/yy"), but this won't help you at all because you can't access your LAN from the internet. To get the external IP address of your network, the one that you would use to connect to it, all he would have to do is go to http://checkip.dyndns.org/ and send you the address it reports. If this is the case, you should look into dyndns for generating a static url for your dynamic ip so that you can avoid this problem in the future.
If you really don't have a LAN then there isn't much that you can do to get the computer's IP from a scan (unless you want to try scanning every IP address in your ISP's pool, then figure out which one is your computer without setting off security alarms somewhere). You will have to ask your friend to log on to your computer and check the IP from it, using either ifconfig or by navigating to the checkip address above. Even if your friend "isn't much of a computer guy", it will be much easier for him to get an external IP from your computer in the absence of a LAN that it would be to get it from another computer.
lycka till iaf ![]()
Last edited by Xyne (2010-03-20 17:33:39)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I have a LAN through my switch, I'm able to autmatically see samba shares etc from my other computers. But the switch doesn't have a DHCP server, the computers IPs are assigned by my ISP.
The question is if network games and samba are able to find the other computers on my LAN it must be possible to find out their IP aswell.
Offline
I have a LAN through my switch, I'm able to autmatically see samba shares etc from my other computers. But the switch doesn't have a DHCP server, the computers IPs are assigned by my ISP.
This seems a bit unusual to me. Could you elaborate on the process which you need to go through to obtain an IP?
I have a feeling that in this case the `ISP' is located within the apartment block (chain?), and that they then allocate an IP(-range?) on their network for your use. If your friend can hook their laptop up to the switch (and access the network), I'm relatively confident the result for checkip.dyndns.org on his laptop would be the same for that of your server.
That said, the hassle-free way might just be to hook up a monitor and keyboard to the box, log in to a tty, and get the IP address via
wget -qO - checkip.dyndns.orgIt may be more difficult for your friend, though should still be fairly straightforward if stepped through it.
Last edited by chpln (2010-03-20 23:17:49)
Offline
I've seen ISPs that do this. Essentially the router is hosted with the ISP so the user does have a LAN but no physical access to the router.
Lazze, the IP addresses of the other computers that you can see on your network will not be the same as the IP address that they have outside of your network (unless this is some IPv6 magic, but I doubt that).
All your friend needs to do is check the external IP at the address that I posted above. Scanning your network will not help because it will just get the internal IP (e.g. 192.168.xxx.xxx). Maybe this will help make it clearer.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
No, I'm 100% sure that my IP addresses are the same on the local network and over the internet. I'm allowed to use up to five IP-addresses at the same time, each IP is reachable from the internet and no port forwarding etc. is necessary when running services as sshd.
I'm also quite sure you're able to have a local network with just a switch. I've set up a few LANs for gaming before and the computers have no problem finding eachother on network games, windows shares etc. on the LAN without using a router and still have an IP assigned from the ISP.
Thanks for all the help and interest in the subject btw!
Offline