LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-22-2017, 07:34 PM   #1
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
I'[m Curious - Is There a Wired Analog?


Having noted that wireless network managers are capable of scanning and delivering a list of all possible one hop connections, I'm curious if the same is possible for ethernet wired devices?

Recently I installed a network printer and tried using netstat and nmap to discover how my PC "saw" the path to the printer and wondered if there was a switch or a command or even an app that would do this quickly.

It's a big field so I welcome any and all comments. Thanks in advance.
 
Old 06-22-2017, 08:06 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,802

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Recently I installed a network printer and tried using netstat and nmap to discover how my PC "saw" the path to the printer and wondered if there was a switch or a command or even an app that would do this quickly.
There are a variety of methods that can be used to discover network printers on a subnet. I frequently use nmap to get the port signatures indicative of a printer listening on particular well-known ports. The CUPS snmp backend can also be useful, and run directly if required...
Code:
/usr/lib/cups/backend/snmp
For reference, I get the following...
Code:
network lpd://HL2150N/BINARY_P1 "Brother HL-2150N series" "Brother HL-2150N series" "MFG:Brother;CMD:PJL,PCL,PCLXL;MDL:HL-2150N series;CLS:PRINTER;" "Office"
I know not all like avahi (and it may not even be installed), but avahi-browse can be used like this...

Code:
# avahi-browse -at
+   eth0 IPv6 linux-kgxs                                    SSH Remote Terminal  local
+   eth0 IPv4 linux-kgxs                                    SSH Remote Terminal  local
+   eth0 IPv6 linux-kgxs                                    SFTP File Transfer   local
+   eth0 IPv4 linux-kgxs                                    SFTP File Transfer   local
+   eth0 IPv4 Brother HL-2150N series                       Web Site             local
+   eth0 IPv4 Brother HL-2150N series                       Internet Printer     local
+   eth0 IPv4 Brother HL-2150N series                       UNIX Printer         local
+   eth0 IPv4 Brother HL-2150N series                       PDL Printer          local
It is even possible to resolve IP addresses with 'avahi-browse -atr'.
 
3 members found this post helpful.
Old 06-23-2017, 11:09 AM   #3
ttk
Senior Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware64
Posts: 1,038
Blog Entries: 27

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
More generally, you can broadcast-ping and any devices on the local network which respond to pings will ping you back.

Use "ifconfig" to see what your interface's broadcast address is, then use ping with the -b option to broadcast-ping. The command will look something like: "ping -b 192.168.1.255"
 
1 members found this post helpful.
Old 06-23-2017, 04:12 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,802

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
The trouble with broadcast pings is that for a large number of hosts on a subnet, the responses don't help identify a printer from other hosts devices without additional steps.
 
Old 06-23-2017, 05:08 PM   #5
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Original Poster
Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
Thanks guys. While it would be nice to see more specifics, something like how WiFi network managers like WiFi Radar can see all that is possible to connect to, even the broadcast ping is something I haven't known about and will find helpful. I only used network printer as one recent example of my wanting to see "what's out there?" so my question is not specific to printers but more to the nature of NICs.
 
Old 06-23-2017, 05:18 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,802

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
The wifi utilities are relying on scans in a defined frequency spectrum and listening for SSID broadcasts. A completely different exercise to network device discovery.
 
Old 06-24-2017, 05:41 PM   #7
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Original Poster
Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
Quote:
Originally Posted by ferrari View Post
The wifi utilities are relying on scans in a defined frequency spectrum and listening for SSID broadcasts. A completely different exercise to network device discovery.
Thanks. I recognize that promiscuity among ethernet devices is a very different (and harshly discouraged) phenomena making a complete comparison impossible or at least highly unlikely but I made this thread as a query to discover just how far such limitations goes and what if anything can be used for discovery. Broadcast ping is a decent start. Is there more?
 
Old 06-24-2017, 06:38 PM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,802

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Broadcast ping is a decent start.
Actually, that is quite limited. It can only confirm that a given device is using a particular IP address, and even then it depends on the hosts not being configured to ignore to such ICMP echo request packets.

Quote:
Is there more?
Yes, and some other approaches have already been mentioned. Open port discovery (eg using nmap), Avahi/Bonjour broadcast discovery, SNMP discovery (for SNMP-enabled devices). In addition to this you can listen to local traffic using utilities such as wireshark. It really depends on what you're actually trying to achieve.
 
Old 06-24-2017, 09:59 PM   #9
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
You could try an ARP scan with arp-scan. There is a SlackBuild:

http://slackbuilds.org/repository/14...earch=arp-scan

Or simply check your arp tables with the "arp" command.
 
Old 06-25-2017, 10:35 AM   #10
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Original Poster
Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
Quote:
Originally Posted by ferrari View Post
Yes, and some other approaches have already been mentioned. Open port discovery (eg using nmap), Avahi/Bonjour broadcast discovery, SNMP discovery (for SNMP-enabled devices). In addition to this you can listen to local traffic using utilities such as wireshark. It really depends on what you're actually trying to achieve.
Actually I'm interested in any fundamental knowledge about how NICs commonly work in different environments and how software detects, handshakes and connects in general but my curiosity began while installing an HP 5740 OfficeJet Printer. Whether through hp-setup commandline or from the HPLIP Status Service GUI no printer was detected. It was necessary to provide IP for it to be "seen" and setup. It took me awhile playing with iterations of nmap to finally discover what my router had setup. Since I have roommates with Macs and Windows PCs that immediately detected and setup the same printer, I wondered what in my system could at least perform that detection. For me that's one of the things I don't cherish about other systems that 'do things for you" since you never learn a thing from hidden processes working behind your back

I do actually prefer having to choose to detect possible connections as opposed to auto-setup but I want to know what to choose to accomplish detection. I also figured I was probably missing out on some valuable switches to commands I already use and don't always find "man" enlightening.
 
Old 06-25-2017, 03:05 PM   #11
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,802

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Actually I'm interested in any fundamental knowledge about how NICs commonly work in different environments and how software detects, handshakes and connects in general but my curiosity began while installing an HP 5740 OfficeJet Printer. Whether through hp-setup commandline or from the HPLIP Status Service GUI no printer was detected. It was necessary to provide IP for it to be "seen" and setup. It took me awhile playing with iterations of nmap to finally discover what my router had setup.
That means your printer was assigned using DHCP. It is common practice to assign a static IP address manually for printers, so that it doesn't change unexpectedly, but most routers also allow the possibility of reserving IP addresses for particular MAC addresses if necessary. Also, 'hp-setp' relies on broadcasts in order to detect a network printer, so it may have been your firewall that prevented discovery. (That can be tweaked if necessary.) Specifying the IP address manually is then necessary.

Quote:
Since I have roommates with Macs and Windows PCs that immediately detected and setup the same printer, I wondered what in my system could at least perform that detection.
HP printers broadcast their presence via Avhai/Bonjour and SLP.

Reference:
http://hplipopensource.com/node/375
 
Old 06-25-2017, 09:39 PM   #12
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Original Poster
Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
Quote:
Originally Posted by ferrari View Post

HP printers broadcast their presence via Avhai/Bonjour and SLP.

Reference:
http://hplipopensource.com/node/375
Ah thank you for that. It makes sense since I have neither of those.
 
  


Reply



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
[SOLVED] Used wired to install now on wireless but system waits for wired dhcpoffer. lonniec Linux - Laptop and Netbook 3 03-08-2011 07:52 PM
How to configure PC for wired/static and wired/DHCP networks? catkin Linux - Networking 2 10-27-2010 10:51 AM
bridging a wireless and wired network causes wired to stop working royce2020 Linux - Networking 0 04-21-2009 04:48 PM
Wireless Laptop to Wired ethernet via Linux PC (wired/wireless) sambartle Linux - Wireless Networking 0 01-30-2005 04:37 AM
Wired to Wireless back to Wired The_Nerd Linux - Hardware 5 09-15-2004 09:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:44 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