SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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...
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'.
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"
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.
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.
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.
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?
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.