Ich hab bisher auch einen HP AOI (HP OfficeJet Pro 7720) in Benutzung und konnte den problemlos auf meinem Desktop und beiden Notebooks einrichten. Ich hab aber auch keine Firewall auf meinem Desktop bzw. den Notebooks laufen, weil ich diese Funktion meiner Fritz!Box überlasse.
Ja, ohne Firewall läuft hier auch alles reibungslos. Ich bin aber in verschiedenen Netzen unterwegs, insofern bin ich da vorsichtiger und würde die Firewall lieber laufenlassen und entsprechend konfigurieren.
Ich bin einen Schritt weiter. Das Problem mit hp-setup scheint zu sein, daß es UDP-Verbindungen von anderen Ports aufmacht anstatt den Standardports (427 für SLP, 5353 für mDNS) - im Beispiel ist .37 mein Rechner, .36 der Drucker:
$ sudo tcpdump -i wlan0 -nn -s0 -v port 427
[sudo] Passwort für root:
tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 262144 bytes
15:17:18.425502 IP (tos 0x0, ttl 4, id 47204, offset 0, flags [DF], proto UDP (17), length 72)
192.168.1.37.40280 > 224.0.1.60.427: UDP, length 44
15:17:19.380883 IP (tos 0x0, ttl 64, id 14, offset 0, flags [none], proto UDP (17), length 564)
192.168.1.36.427 > 192.168.1.37.40280: UDP, length 536
^C
2 packets captured
2 packets received by filter
0 packets dropped by kernel
Alles anzeigen
Die kommen entsprechend nicht mehr durch die Firewall, selbst wenn dort SLP freigegeben ist, denn die Freigabe bezieht sich ja nur auf Port 427. Wenn ich eine zusätzliche Firewallregel einfüge, die UDP-Pakete mit Source-Port 427 ebenfalls erlaubt, funktioniert es mit SLP:
calypso:~ # firewall-cmd --list-all
home (active)
target: default
icmp-block-inversion: no
interfaces: wlan0
sources:
services: dhcpv6-client mdns slp ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
calypso:~ # hp-setup
HP Linux Imaging and Printing System (ver. 3.19.12)
Printer/Fax Setup Utility ver. 9.0
Copyright (c) 2001-18 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.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Searching... (bus=net, timeout=5, ttl=4, search=(None) desc=0, method=slp)
error: No devices found on bus: net
error: HPLIP cannot detect printers in your network. This may be due to existing firewall settings blocking the required ports.
When you are in a trusted network environment, you may open the ports for network services like mdns and slp in the firewall. For detailed steps follow the link.
http://hplipopensource.com/node/374
Done.
calypso:~ # firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -p udp -m udp --sport 427 -m conntrack --ctstate NEW -j ACCEPT
success
calypso:~ # hp-setup
HP Linux Imaging and Printing System (ver. 3.19.12)
Printer/Fax Setup Utility ver. 9.0
Copyright (c) 2001-18 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.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Searching... (bus=net, timeout=5, ttl=4, search=(None) desc=0, method=slp)
Done.
calypso:~ #
Alles anzeigen
Mit mDNS und einer entsprechenden Firewallregel für Port 5353 funktioniert es dagegen nach wie vor nicht. Die Ausgangssituation ist die gleiche (hp-setup versucht eine UDP-Verbindung über eine hohe Portnummer aufzumachen):
$ sudo tcpdump -i wlan0 -nn -s0 -v port 5353
[sudo] Passwort für root:
tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 262144 bytes
15:24:55.315516 IP (tos 0x0, ttl 4, id 3036, offset 0, flags [DF], proto UDP (17), length 72)
192.168.1.37.58236 > 224.0.0.251.5353: 0 PTR (QM)? _pdl-datastream._tcp.local. (44)
15:24:55.319746 IP (tos 0x0, ttl 64, id 189, offset 0, flags [none], proto UDP (17), length 653)
192.168.1.36.5353 > 192.168.1.37.58236: 0*- 1/0/5 _pdl-datastream._tcp.local. PTR HP OfficeJet Pro 8710 [AD5ECE]._pdl-datastream._tcp.local. (625)
15:24:56.317750 IP (tos 0x0, ttl 4, id 3186, offset 0, flags [DF], proto UDP (17), length 72)
192.168.1.37.58236 > 224.0.0.251.5353: 0 PTR (QM)? _pdl-datastream._tcp.local. (44)
15:24:56.322318 IP (tos 0x0, ttl 64, id 190, offset 0, flags [none], proto UDP (17), length 653)
192.168.1.36.5353 > 192.168.1.37.58236: 0*- 1/0/5 _pdl-datastream._tcp.local. PTR HP OfficeJet Pro 8710 [AD5ECE]._pdl-datastream._tcp.local. (625)
15:24:58.321240 IP (tos 0x0, ttl 4, id 3625, offset 0, flags [DF], proto UDP (17), length 72)
192.168.1.37.58236 > 224.0.0.251.5353: 0 PTR (QM)? _pdl-datastream._tcp.local. (44)
15:24:58.325401 IP (tos 0x0, ttl 64, id 191, offset 0, flags [none], proto UDP (17), length 653)
192.168.1.36.5353 > 192.168.1.37.58236: 0*- 1/0/5 _pdl-datastream._tcp.local. PTR HP OfficeJet Pro 8710 [AD5ECE]._pdl-datastream._tcp.local. (625)
^C
6 packets captured
6 packets received by filter
0 packets dropped by kernel
Alles anzeigen
Allerdings wenn ich dann eine Firewallregel einfüge, die UDP-Pakete von Port 5353 erlauben soll, findet hp-setup den Drucker immer noch nicht:
calypso:~ # firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -p udp -m udp --sport 5353 -m conntrack --ctstate NEW -j ACCEPT
success
calypso:~ # hp-setup
HP Linux Imaging and Printing System (ver. 3.19.12)
Printer/Fax Setup Utility ver. 9.0
Copyright (c) 2001-18 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.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Searching... (bus=net, timeout=5, ttl=4, search=(None) desc=0, method=mdns)
error: No devices found on bus: net
error: HPLIP cannot detect printers in your network. This may be due to existing firewall settings blocking the required ports.
When you are in a trusted network environment, you may open the ports for network services like mdns and slp in the firewall. For detailed steps follow the link.
http://hplipopensource.com/node/374
Done.
Alles anzeigen
Da SLP aber bei hp-setup die Standardeinstellung ist, werde ich hiermit erst einmal leben können. Sollte sich noch etwas tun, werde ich es hier dokumentieren.