Re: Creating a Firewall for Your Ubuntu Desktop
Question:
I have just installed and configure the firewall with the info here and everything work. However, my wireless network printer (it was tested before configure the firewall) is not working now. I know that is the firewall setting because when it is disable the printer work. So my question is how I create a rule to allow the printer? Can you point me out a link to get more info on this?
Re: Creating a Firewall for Your Ubuntu Desktop
Quote:
Originally Posted by
Electron
Question:
I have just installed and configure the firewall with the info here and everything work. However, my wireless network printer (it was tested before configure the firewall) is not working now. I know that is the firewall setting because when it is disable the printer work. So my question is how I create a rule to allow the printer? Can you point me out a link to get more info on this?
Make sure TCP 631 is open. Also do a search on your printer as another port may need to be open. :)
Re: Creating a Firewall for Your Ubuntu Desktop
Quote:
Originally Posted by
Electron
Question:
I have just installed and configure the firewall with the info here and everything work. However, my wireless network printer (it was tested before configure the firewall) is not working now. I know that is the firewall setting because when it is disable the printer work. So my question is how I create a rule to allow the printer? Can you point me out a link to get more info on this?
What I did was open ufw log file viewer and saw that port 9100 tcp was being blocked whenever I tried to access my HP wireless printer.
Opened the port in ufw & all was well.
Re: Creating a Firewall for Your Ubuntu Desktop
@Azrael84; Hey, I had the same problem with Transmisson, you just have to add a rule for 80,6969/udp, wich are the ports used by trackers, cheers.
Re: Creating a Firewall for Your Ubuntu Desktop
Leopard Flower personal firewall for Linux (LPFW) gives the user control over which applications are allowed to use the network and is very easy to setup. Detailed steps are shown below
- These packages should be installed for compiling-
- iptables
- libnetfilter-queue
- libnetfilter-conntrack
- python-qt4
- libnetfilter-queue-dev
- libnetfilter-conntrack-dev
- libcap-devlibpython2.6
- zenity
- python2.6-dev
- Download source code of leopard ( I have used leopard version -0.4 on ubuntu 12.04 i386)
- extract the zip file
- Open terminal and cd to that directory
- Execute following commands
- mkdir build
- cd build
- make -C ../ DESTDIR=`pwd`
- Now 'build' folder will contain lpfw-pygui folder and three binary files lpfwcli, lpfw, lpfwgui, lpfw
- Include one more file in this folder in the name 'leopardclient' and add following text into it
Quote:
#!/bin/sh
set -e
cd `pwd`
#!/bin/sh
pkill -9 -f lpfwgui.py
cd /usr/local/leopardfirewall
pidof lpfwpygui && yes=1 || yes=0
if [ $yes -eq 1 ]
then
echo "Some other user has started lpfwpygui"
else
echo "starting lpfwpygui-1"
./lpfwpygui
fi
- Give execution permission to this file. (In Nautilus file manager-: property>permisssion> Execution: <tick>)
- Copy build folder into /usr/local and rename as say, leopardfirewall (for that you have to open nautilus in as root user; execute: sudo nautilus /usr/local )
- Now make usergroup with name "lpfw" (Make use of Users and Group application). Don't add any user into this account
- Now we have to start lpfw as root user on boot up, for that do following
- In etc/init.d make a file in the name 'leopard' and add following text into it
Quote:
#!/bin/sh
# Starts and stops leopard -lpfw
#
case "$1" in
start)
start-stop-daemon --start --exec /usr/local/leopardfirewall/lpfw
;;
stop)
start-stop-daemon --stop --exec /usr/local/leopardfirewall/lpfw
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
- In etc/init make a file in the name 'leopard.conf' and add following text into it
Quote:
start on (starting networking and started rsyslog)
exec /usr/local/leopardfirewall/lpfw
- Now you restart PC and login , you will find that application cannot access internet. open terminal and execute '/usr/local/leopardfirewall/leopardclient'
- Now gui will open and ask for your permission to allow/deny applications
- Once you have allowed/denied permanently that rule will be added to /etc/lpfw.rules. and those applications can access internet even if you have not started leopardclient software.
- If want to open leopardclient from dash or application menu, do following
- Make a file in '/usr/share/applications/' in name 'LEOPARD.desktop' add the following and make execution bit true
Quote:
[Desktop Entry]
Version=0.4
Type=Application
Terminal=false
Exec=/usr/local/leopardfirewall/lpfw
Name=Firewall-Leopard client
Comment=Allows you to allow internet access
Icon=/usr/share/icons/filefWo6iH.png
Categories=Application;Network;
(see whether icon is present in the folder or assign a picture of your choice)
- Now Firewall-Leopard client will appear under internet applications
:)-----------------------------------------------------------------------------------------------------------------------:)
Re: Creating a Firewall for Your Ubuntu Desktop
Thanks for the great guide. I installed GUFW and lost communication to my 2 wifi printers. Is there another port I need to allow?
Re: Creating a Firewall for Your Ubuntu Desktop
I'd suggest turning off your firewall, opening a terminal and enter the following command:
Code:
sudo watch netstat -anltp
then send a print job to each of your wireless printer,
you should see something like this:
Code:
tcp 0 27304 192.168.0.102:38328 192.168.0.109:9100 ESTABLISHED 32171/192.168.0.109
In the above example the ip address of the system I'm using is 192.168.0.102, and the ip address of the networked printer is 192.168.0.109. you can tell which ports they are using by the number after the ip address, in this case the host is using port #38328, and the printer is using port #9100. With this info in hand, you should be able to choose what ports to leave open in order to print.
Re: Creating a Firewall for Your Ubuntu Desktop (the original Poster)
Re: Creating a Firewall for Your Ubuntu Desktop (the original Poster)
Quote:
Originally Posted by
six^letters^digits
Your 4 links are dead.