LinuxQuestions.org
Visit Jeremy's Blog.
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 05-02-2006, 02:56 PM   #1
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539

Rep: Reputation: 30
find ip addresses on lan


I just moved and have setup my lan again.
Everythings except for the printer.
I can't get windows or linux to see it.
Its ip address was 192.168.0.10
How do i see what it is now?
How do i see the ip address of all things on the lan?
 
Old 05-02-2006, 03:16 PM   #2
avatarfx
Member
 
Registered: May 2004
Posts: 34

Rep: Reputation: 16
Quick answer, use a portscanner like NMAP. Here is a sample to scan all of your range.

Given a network 192.168.0.0 with submask 255.255.255.0 (24 bits), then:

root@linux#nmap -sP 192.168.0.0/24

An Voila! Just make sure that your printer is connected to the network and turned on before doing the previous step. Now, being realistic and considering that is YOUR printer, you can always access the printer configuration on the printer itself, OR you can get the registered LAN addresses on your router.

Cheers
 
Old 05-02-2006, 03:17 PM   #3
ku4tp
LQ Newbie
 
Registered: Aug 2004
Distribution: SuSE
Posts: 24

Rep: Reputation: 15
Don't know how much help I can be, but I'll try until someone more knowledgeable comes along *S*.

When you say the printer "can't be seen" can you elaborate? Start off by opening a console (or command prompt in Windows) and type 'ping 192.168.0.10' (without the quotes, of course). Let us know the result. Unless you are using a DHCP server (and your router might) or you caused a reset of some sort the IP address of the printer should not have changed. Or you might check to see if your printer has a reset that would force it back to a default IP. Don't forget to check the hardware - one bad cable can cause a lot of trouble. And as silly as it sounds make sure you have power to your hub/router or whatever. I suspect you do, since you say everthing else works.

CUPS should have no problem with a network printer. I'm guessing everything worked prior to the move, yes?
 
Old 05-02-2006, 03:21 PM   #4
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539

Original Poster
Rep: Reputation: 30
> ping 192.168.0.10
PING 192.168.0.10 (192.168.0.10) 56(84) bytes of data.
From 192.168.0.101: icmp_seq=2 Destination Host Unreachable
From 192.168.0.101 icmp_seq=2 Destination Host Unreachable
From 192.168.0.101 icmp_seq=3 Destination Host Unreachable
From 192.168.0.101 icmp_seq=4 Destination Host Unreachable
From 192.168.0.101 icmp_seq=6 Destination Host Unreachable
...

what does this mean?
 
Old 05-02-2006, 03:22 PM   #5
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539

Original Poster
Rep: Reputation: 30
> ping 192.168.0.10
PING 192.168.0.10 (192.168.0.10) 56(84) bytes of data.
64 bytes from 192.168.0.10: icmp_seq=1 ttl=254 time=1.23 ms
64 bytes from 192.168.0.10: icmp_seq=2 ttl=254 time=0.616 ms
64 bytes from 192.168.0.10: icmp_seq=3 ttl=254 time=0.681

that's better
 
Old 05-02-2006, 03:25 PM   #6
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539

Original Poster
Rep: Reputation: 30
>>Don't forget to check the hardware
consarnit, you're right. the ethernet cable as not quite plugged in all the way.
thanks.
 
Old 05-02-2006, 08:44 PM   #7
vimal
Red Hat India
 
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260

Rep: Reputation: 36
Hello allelopath,


I think you got the answer. But in times of need, knowing how to check hosts which are up would be useful. Ping is useful but it is laggy and would just drop and wait for the response of the client machine, if the client was down. As 'avatarfx' said earlier we can use scanning tools like nmap to check the hosts currently listening on the network. Just issue the command underneath and you get the results in a matter of seconds, really nmap is a great tool.

# nmap -sP subnet/netmask |grep Host|awk '{print $2}'

Here nmap does a ping-sweep test once and the output, as you can see, is truncated using GREP and AWK to present a list of IPs.


I hope that bit was useful.

Thanks,,,,,

Last edited by vimal; 05-02-2006 at 08:50 PM.
 
Old 05-02-2006, 11:06 PM   #8
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539

Original Poster
Rep: Reputation: 30
vimal, thanks for the reply.
I cut'n'pasted the command you gave, but it doesn't like it:

> nmap -sP subnet/netmask |grep Host|awk '{print $2}'
Failed to resolve given hostname/IP: subnet. Note that you can't use '/mask' AND '[1-4,7,100-]' style IP ranges
 
Old 05-02-2006, 11:54 PM   #9
vimal
Red Hat India
 
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260

Rep: Reputation: 36
Hello allelopath,

Have you replaced the 'subnet/netmask' with your range? You have not, thats the problem.

An example:=== If you are using the class C range, such as 192.168.10.0, you could replace the 'subnet/netmask' as "nmap -sP 192.168.10.0/24|grep Host|awk '{print $2}' " I hope this would solve the problem, I have this working properly at my end.

Please reply in case of need,.

Thanks .....
 
Old 05-03-2006, 08:14 AM   #10
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539

Original Poster
Rep: Reputation: 30
oh geez, sorry, i shouldn't have been doing that so late at night.
> nmap -sP 192.168.0.0/24|grep Host|awk '{print $2}'
192.168.0.1
192.168.0.10

that's better.
thanks, that's a handy command
 
  


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
Conflicting IP addresses in LAN? Joe Soap Linux - Networking 2 05-05-2005 04:36 PM
how to find out IP addresses kpachopoulos General 1 12-02-2004 07:45 AM
How to find IP addresses on a network dubya Linux - Networking 2 09-23-2004 03:27 AM
LAN with static IP addresses and shared internet connection #2 Klas Linux - Networking 10 01-26-2004 10:43 AM
LAN with static IP addresses and shared internet connection Klas Mandriva 1 01-21-2004 07:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration