LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to scan for ip addresses in a local network? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-scan-for-ip-addresses-in-a-local-network-623960/)

icedfusion 02-26-2008 09:12 AM

How to scan for ip addresses in a local network?
 
Hi,

I am setting up some friends with Linux and as I expect to support them I want to setup a secure VNC connection.

I have it all setup so that i ssh into their machine, setup the port forwarding and connect via VNC. Splendid!!

The problem that i might have is that i ssh into their network but I won't know what ip address their machine is at, so my question is:

Is there any easy way to scan their local network for ip addresses that are up?

I know there is nmap - but with this you have to specify the start of the ipaddress and a range to scan - is their no way to just scan a network for available ip's?


Cheers

ice.

Simon Bridge 02-26-2008 09:27 AM

Quote:

Is there any easy way to scan their local network for ip addresses that are up?
http://sourceforge.net/projects/multiscan
Quote:

I know there is nmap - but with this you have to specify the start of the ipaddress and a range to scan - is their no way to just scan a network for available ip's?
Well... set the start IP to 0.0.0.0 and the end to 255.255.255.255 (but what about ipv6?)

If you know what sort of network it is you can narrow that down:
192.168.0.0 to 192.168.255.255

I mean - how is the program supposed to know what to scan if you don't tell it?

Quote:

The problem that i might have is that i ssh into their network but I won't know what ip address their machine is at
So... ask them?

farslayer 02-26-2008 10:04 AM

I don't see where nmap is all that difficult, it's a very short, simple command to do a network scan
Quote:

nmap -sP 192.168.1.0/24

(content removed)


Nmap finished: 256 IP addresses (72 hosts up) scanned in 15.280 seconds.

That will do a simple PING scan of the entire 192.168.1.0 subnet, and resolve names via DNS if possible and list everything found for you.

icedfusion 02-26-2008 10:47 AM

Thanks for the replies.

'asking' them i am often met with 'ip address?? whats that and how do i get it' - sometimes i just want to be able to say 'i will log in later and fix it for you'.

Sounds like i will stick with nmap.

Cheers

ice.

Simon Bridge 02-26-2008 11:21 AM

Quote:

I am setting up some friends with Linux and as I expect to support them ... Is there any easy way to scan their local network for ip addresses that are up?
Quote:

'asking' them i am often met with 'ip address?? whats that and how do i get it'
So you ask the sysadmin... wait: that's you!

jantman 02-26-2008 11:41 AM

How are you SSHing into their network if you don't know the machine's IP?

If they're on residential connections, you'll need to configure port forwarding on their router and then just give their box a static IP via the DHCP server (or... eww... manually).

acid_kewpie 02-26-2008 03:50 PM

how about this then?
Code:

nmap -sP $(ip -o addr show | grep inet\  | grep eth | cut -d\  -f 7)
automatically picks up all local ethernet subnets and in cidr format and scans them all. probably a better way to get the IP, but that'll do in my world.

icedfusion 02-27-2008 03:10 AM

Quote:

Originally Posted by jantman (Post 3070483)
How are you SSHing into their network if you don't know the machine's IP?

If they're on residential connections, you'll need to configure port forwarding on their router and then just give their box a static IP via the DHCP server (or... eww... manually).

i have setup a dyndns, so getting to the network and doing port fwding for the one machine is simple:


Code:

ssh someones.connection.org -L 5900/localhost/5900
My problem was with the fact if there is more than one computer on the network that I may need to support - then i have to change the 'localhost' to the ip address of the computer i wish to VNC into.

As for the router fwding port 22 - i only want 1 machine to have a static ip on the local lan.

However, there appears to have been some good suggestions so I will give those a try.

Thanks

ice.

farslayer 02-27-2008 08:24 AM

or setup something like ssl-explorer which can be hit through a single gateway and used to access multiple machines.

http://en.wikipedia.org/wiki/SSL-Exp...munity_Edition

Quote:

Some resources (e.g. remote desktop access) require the use of port forwarding to operate successfully. For this purpose a lightweight Java applet known as the 'SSL-Explorer Agent' is downloaded and launched by the client browser. The applet intercepts TCP/IP requests on certain configurable ports and forwards them to the SSL-Explorer server which in turn routes them to the appropriate endpoint on the network.

icedfusion 02-27-2008 09:15 AM

Quote:

Originally Posted by farslayer (Post 3071505)
or setup something like ssl-explorer which can be hit through a single gateway and used to access multiple machines.

http://en.wikipedia.org/wiki/SSL-Exp...munity_Edition


Thanks for the suggestion - will look into that.


Cheers.

ice.

yann1108 09-12-2011 02:46 PM

update to scanning IP addresses in Ubuntu question
 
may I suggest a nice application called: UMIT
downloadable via the Ubuntu Software Center
It's a graphical interface for "nmap" command line
all your IP scan needs under one roof.


All times are GMT -5. The time now is 07:04 PM.