Last active
May 13, 2024 13:36
-
-
Save kuri65536/75cdc4819920dff6f9baab9ff3e83192 to your computer and use it in GitHub Desktop.
iptables allow ports commands for HP Printer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if1=br0 | |
if2=wlan1 | |
net=192.168.2.0/24 | |
ip=192.168.2.2 | |
iptables -I FORWARD -i $if1 -o $if2 -s $net -d $ip -p udp -m multiport \ | |
--dports 80,137,138,161,427,443,5222,5223,5297,5298,5353 \ | |
-m state --state NEW -j ACCEPT | |
iptables -I FORWARD -i $if1 -o $if2 -s $net -d $ip -p tcp -m multiport \ | |
--dports 80,137,139,427,443,5222,5223,5297,5298,5353,9100,9220,9500 \ | |
-m state --state NEW -j ACCEPT | |
cat <<EOF | |
# Tested with HP OfficeJet 6500 | |
## Ubuntu -> Printer | |
you need the port 9100/tcp only. | |
## Android -> Printer | |
you need several ports in below commands. | |
## Reference | |
- https://h30434.www3.hp.com/t5/Inkjet-Printing/iptables-port-rules-for-HP-printing-scanning-amp-ePrint-app/td-p/5585381 | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment