LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 02-26-2008, 09:12 AM   #1
icedfusion
Member
 
Registered: Jun 2004
Posts: 31

Rep: Reputation: 15
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.
 
Old 02-26-2008, 09:27 AM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
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?
 
Old 02-26-2008, 10:04 AM   #3
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,228
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
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.

Last edited by farslayer; 02-26-2008 at 10:06 AM.
 
1 members found this post helpful.
Old 02-26-2008, 10:47 AM   #4
icedfusion
Member
 
Registered: Jun 2004
Posts: 31

Original Poster
Rep: Reputation: 15
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.
 
Old 02-26-2008, 11:21 AM   #5
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
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!
 
Old 02-26-2008, 11:41 AM   #6
jantman
Member
 
Registered: Nov 2005
Location: New Jersey, USA
Distribution: SuSE
Posts: 492

Rep: Reputation: 31
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).
 
Old 02-26-2008, 03:50 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,408

Rep: Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965
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.

Last edited by acid_kewpie; 02-26-2008 at 03:52 PM.
 
1 members found this post helpful.
Old 02-27-2008, 03:10 AM   #8
icedfusion
Member
 
Registered: Jun 2004
Posts: 31

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jantman View Post
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.
 
Old 02-27-2008, 08:24 AM   #9
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,228
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
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.
 
Old 02-27-2008, 09:15 AM   #10
icedfusion
Member
 
Registered: Jun 2004
Posts: 31

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by farslayer View Post
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.
 
Old 09-12-2011, 02:46 PM   #11
yann1108
LQ Newbie
 
Registered: Sep 2011
Posts: 1

Rep: Reputation: Disabled
Smile 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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
scan a block of addresses fentonc2003 Linux - Networking 1 11-21-2006 04:33 AM
How can I scan my network for IP addresses? dbc001 Linux - Software 4 08-06-2006 02:31 PM
local addresses LQtor Linux - Networking 1 03-15-2004 03:05 PM
Squid and resolving local addresses on network lumpyhed Linux - Networking 1 03-12-2004 08:31 AM
Cannot resolve local addresses on local network danielgrenyer Linux - Networking 6 01-14-2004 11:03 AM


All times are GMT -5. The time now is 07:30 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration