HPLIP cannot detect printers in my network. A existing firewall (UFW) blocking the required ports. But... ports are open

Asked by ghreyes71

1. Linux Distribution and version.
- Debian GNU/Linux 8.10 (jessie)

2. Your printer make/model.
- HP-LaserJet-MFP-M527

3. If possible, run 'hp-check -t' and post the output.

# hp-check -t
Saving output in log file: /root/hp-check.log

HP Linux Imaging and Printing System (ver. 3.17.11)
Dependency/Version Check Utility ver. 15.1

Copyright (c) 2001-15 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Note: hp-check can be run in three modes:
1. Compile-time check mode (-c or --compile): Use this mode before compiling the HPLIP supplied tarball (.tar.gz or .run) to determine if the proper dependencies are
installed to successfully compile HPLIP.
2. Run-time check mode (-r or --run): Use this mode to determine if a distro supplied package (.deb, .rpm, etc) or an already built HPLIP supplied tarball has the proper
dependencies installed to successfully run.
3. Both compile- and run-time check mode (-b or --both) (Default): This mode will check both of the above cases (both compile- and run-time dependencies).

Check types:
a. EXTERNALDEP - External Dependencies
b. GENERALDEP - General Dependencies (required both at compile and run time)
c. COMPILEDEP - Compile time Dependencies
d. [All are run-time checks]
PYEXT SCANCONF QUEUES PERMISSION

Status Types:
    OK
    MISSING - Missing Dependency or Permission or Plug-in
    INCOMPAT - Incompatible dependency-version or Plugin-version

---------------
| SYSTEM INFO |
---------------

 Kernel: 3.16.0-4-amd64 #1 SMP Debian 3.16.51-3 (2017-12-13) GNU/Linux
 Host: B1842ZACD0001
 Proc: 3.16.0-4-amd64 #1 SMP Debian 3.16.51-3 (2017-12-13) GNU/Linux
 Distribution: 2 8.10
 Bitness: 64 bit

-----------------------
| HPLIP CONFIGURATION |
-----------------------

HPLIP-Version: HPLIP 3.17.11
HPLIP-Home: /usr/share/hplip
HPLIP-Installation: Auto installation is supported for debian distro 8.10 version

Current contents of '/etc/hp/hplip.conf' file:
# hplip.conf. Generated from hplip.conf.in by configure.

[hplip]
version=3.17.11

[dirs]
home=/usr/share/hplip
run=/var/run
ppd=/usr/share/ppd/HP
ppdbase=/usr/share/ppd
doc=/usr/share/doc/hplip-3.17.11
html=/usr/share/doc/hplip-3.17.11
icon=/usr/share/applications
cupsbackend=/usr/lib/cups/backend
cupsfilter=/usr/lib/cups/filter
drv=/usr/share/cups/drv/hp
bin=/usr/bin
apparmor=/etc/apparmor.d
# Following values are determined at configure time and cannot be changed.
[configure]
network-build=yes
libusb01-build=no
pp-build=no
gui-build=yes
scanner-build=yes
fax-build=yes
dbus-build=yes
cups11-build=no
doc-build=yes
shadow-build=no
hpijs-install=no
foomatic-drv-install=no
foomatic-ppd-install=no
foomatic-rip-hplip-install=no
hpcups-install=yes
cups-drv-install=yes
cups-ppd-install=no
internal-tag=3.17.11
restricted-build=no
ui-toolkit=qt5
qt3=no
qt4=no
qt5=yes
policy-kit=no
lite-build=no
udev_sysfs_rules=no
hpcups-only-build=no
hpijs-only-build=no
apparmor_build=yes
class-driver=no

Current contents of '/var/lib/hp/hplip.state' file:
Plugins are not installed. Could not access file: No such file or directory

Current contents of '~/.hplip/hplip.conf' file:
warning: Could not access file: No such file or directory
 <Package-name> <Package-Desc> <Required/Optional> <Min-Version> <Installed-Version> <Status> <Comment>

--------------
| COMPILEDEP |
--------------

 gcc gcc - GNU Project C and C++ Compiler REQUIRED - 4.9.2 OK -
 make make - GNU make utility to maintain groups of programs REQUIRED 3.0 4.0 OK -
 libtool libtool - Library building support services REQUIRED - 2.4.2 OK -

------------------------
| General Dependencies |
------------------------

 pyqt5-dbus PyQt 5 DBus - DBus Support for PyQt5 REQUIRED 5.0 5.3.2 OK -
 libcrypto libcrypto - OpenSSL cryptographic library REQUIRED - 1.0.1 OK -
 python-xml Python XML libraries REQUIRED - 2.1.0 OK -
 libnetsnmp-devel libnetsnmp-devel - SNMP networking library development files REQUIRED 5.0.9 5.7.2 OK -
 sane-devel SANE - Scanning library development files REQUIRED - 1.0.24 OK -
 pil PIL - Python Imaging Library (required for commandline scanning with hp-scan) OPTIONAL - 1.1.7 OK -
 libpthread libpthread - POSIX threads library REQUIRED - 2.19 OK -
 python-devel Python devel - Python development files REQUIRED 2.2 2.7.9 OK -
 cups-devel CUPS devel- Common Unix Printing System development files REQUIRED - 1.7.5 OK -
 python-dbus Python DBus - Python bindings for DBus REQUIRED 0.80.0 1.2.0 OK -
 cups-ddk CUPS DDK - CUPS driver development kit OPTIONAL - - OK -
 reportlab Reportlab - PDF library for Python OPTIONAL 2.0 3.1.8 OK -
 pyqt5 PyQt 5- Qt interface for Python (for Qt version 4.x) REQUIRED 5.0 5.3.2 OK -
 libusb libusb - USB library REQUIRED - 1.0 OK -
 cups-image CUPS image - CUPS image development files REQUIRED - 1.7.5 OK -
 python2X Python 2.2 or greater - Python programming language REQUIRED 2.2 2.7.9 OK -
 python-notify Python libnotify - Python bindings for the libnotify Desktop notifications OPTIONAL - - OK -
 libjpeg libjpeg - JPEG library REQUIRED - - OK -
 sane SANE - Scanning library REQUIRED - 1.0.24 OK -

----------------------
| Scan Configuration |
----------------------

 scanext Scan-SANE-Extension REQUIRED - 3.17.11 OK -
 hpaio HPLIP-SANE-Backend REQUIRED - 3.17.11 OK 'hpaio found in /etc/sane.d/dll.conf'

-------------------------
| External Dependencies |
-------------------------

 gs GhostScript - PostScript and PDF language interpreter and previewer REQUIRED 7.05 9.06 OK -
 scanimage scanimage - Shell scanning program OPTIONAL 1.0 1.0.24 OK -
 cups CUPS - Common Unix Printing System REQUIRED 1.1 1.7.5 OK 'CUPS Scheduler is running'
 network network -wget OPTIONAL - 1.16 OK -
 policykit PolicyKit - Administrative policy framework OPTIONAL - 0.105 OK -
 xsane xsane - Graphical scanner frontend for SANE OPTIONAL 0.9 0.998 OK -
 dbus DBus - Message bus system REQUIRED - 1.8.22 OK -
 avahi-utils avahi-utils OPTIONAL - 0.6.31 OK -

---------------------
| Python Extentions |
---------------------

 hpmudext IO-Extension REQUIRED - 3.17.11 OK -
 cupsext CUPS-Extension REQUIRED - 3.17.11 OK -

------------------------------
| DISCOVERED SCANNER DEVICES |
------------------------------

No Scanner found.

--------------------------
| DISCOVERED USB DEVICES |
--------------------------

No devices found.

---------------------------------
| INSTALLED CUPS PRINTER QUEUES |
---------------------------------

CL4NX-203dpi
------------
Type: Unknown
Device URI: usb://SATO/CL4NX%20203dpi?serial=JYDZ0519
PPD: /etc/cups/ppd/CL4NX-203dpi.ppd
PPD Description: SATO CL4NX 203dpi
Printer Unplugged or turned off03dpi disabled since Fri 05 Jan 2018 11:12:58 AM -03 -
warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices.

HP_LaserJet_MFP_M527
--------------------
Type: Printer
Device URI: hp:/net/HP_LaserJet_MFP_M527?ip=10.254.62.32
PPD: /etc/cups/ppd/HP_LaserJet_MFP_M527.ppd
PPD Description: HP LaserJet MFP M527 Postscript (recommended)
Printer status: printer HP_LaserJet_MFP_M527 is idle. enabled since Fri 26 Jan 2018 02:22:06 PM -03
Communication status: Good

--------------
| PERMISSION |
--------------

-----------
| SUMMARY |
-----------

Missing Required Dependencies
-----------------------------
None

Missing Optional Dependencies
-----------------------------
None

Total Errors: 0
Total Warnings: 4

Done.

4. A detailed explanation of your problem.

- HPLIP cannot detect printers in my network. A existing firewall (UFW) blocking the required ports.
- But... ports are open:

# ufw status
Status: active

To Action From
-- ------ ----
22/tcp LIMIT IN Anywhere
10.254.62.7 427/udp ALLOW Anywhere
10.254.62.7 5353/udp ALLOW Anywhere

Log:
kernel: [196582.112082] [UFW BLOCK] IN=eth0 OUT= MAC=fc:aa:14:99:3e:aa:00:01:e6:74:8c:9a:08:00 SRC=10.254.62.33 DST=10.254.62.7 LEN=323 TOS=0x00 PREC=0x00 TTL=64 ID=1094 PROTO=UDP SPT=427 DPT=34071 LEN=303

In basis a https://support.hp.com/us-en/document/c01856593 I probe this rule:
ufw allow from any to 10.254.62.7 port 427,9220,161,5353,9500,9290,139,9100 proto udp
But didnt work.

5. Steps to recreate the problem.

Rules of UFW

ufw default deny
ufw logging low
ufw limit ssh/tcp
ufw allow from any to 10.254.62.7 port 427 proto udp
ufw allow from any to 10.254.62.7 port 5353 proto udp

Question information

Language:
English Edit question
Status:
Answered
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
ghreyes71 (ghreyes71) said :
#1

I just add 137/UDP but nothing happend

ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing)
New profiles: skip

To Action From
-- ------ ----
22/tcp LIMIT IN Anywhere
10.254.62.7 427/udp ALLOW IN Anywhere
10.254.62.7 5353/udp ALLOW IN Anywhere
10.254.62.7 137/udp ALLOW IN Anywhere

Revision history for this message
Afshan F (afshan) said :
#2

Hi Ghreyes,

Please click on Show Advanced Options button in the Device Discovery window and change the Network Discovery Method to mDNS/Bonjour. It should successfully detect the printer with this method.

And if you are still facing the issue, please go through the below link
http://www.mygnulinux.com/?p=1192

Thanks,
Afshan

Revision history for this message
ghreyes71 (ghreyes71) said :
#3

Hi Afshan

I had already tried that option with the same result.

Feb 22 09:20:06 B1842ZACD0001 kernel: [692911.771209] [UFW BLOCK] IN=eth0 OUT= MAC=fc:aa:14:99:3e:aa:30:8d:99:2e:63:a6:08:00 SRC=10.254.62.68 DST=10.254.62.7 LEN=408 TOS=0x00 PREC=0x00 TTL=0 ID=39111 PROTO=UDP SPT=5353 DPT=42803 LEN=388

[ 10.254.62.68 is a HP LaserJet MFP M426fdw ]

Feb 22 09:20:06 B1842ZACD0001 kernel: [692911.771226] [UFW BLOCK] IN=eth0 OUT= MAC=fc:aa:14:99:3e:aa:30:8d:99:2e:63:99:08:00 SRC=10.254.63.13 DST=10.254.62.7 LEN=408 TOS=0x00 PREC=0x00 TTL=0 ID=31678 PROTO=UDP SPT=5353 DPT=42803 LEN=388

[ 10.254.63.13 is a HP LaserJet MFP M426fdw]

Note the PROTO and SPT... Are OPEN:

[ 6] 10.254.62.7 5353/udp ALLOW IN Anywhere

But is blocked.

Revision history for this message
Afshan F (afshan) said :
#4

Hi Ghreyes,

Please try the below steps followed.

Disable Debian Firewall

iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

Other debian settings:

/etc/hosts.deny

This setting in the above file will deny traffic from any source except locally:

ALL:ALL EXCEPT 127.0.0.1:DENY

Comment out this line like so:

#ALL:ALL EXCEPT 127.0.0.1:DENY

Let me know if you are still facing the issue

Thanks,
Afshan

Can you help with this problem?

Provide an answer of your own, or ask ghreyes71 for more information if necessary.

To post a message you must log in.