Ubuntu: How to find port of a network scanner for UFW



Question:

Samsung multi-functional device SXC 3205w works perfectly with my Ubuntu 12.04 and I can scan and print over network, but only when firewall is disabled.

How can I find out which port to enable in UFW to make this printer work and have my firewall enabled?


Solution:1

You can use fallowing command to trace communication between pc and printer

sudo tcpdump -i interface | grep ip_address_of_printer  

You will see output of network communication, protocol, port ...

After that you can set ufw

Another way is to use command

netstat -atu | grep ip_address_of_printer  

With this command you will see active connection between pc and printer.

Also you can allow all trafic for printer ip address

sudo ufw allow from ip_address_of_printer  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »