Thursday, January 7, 2010

samba with ufw firewll tutorial in Ubuntu

Under Ubuntu 8.10 I find the firewall. For the first time met and was surprised how easy is it to implement such a thing yet. In this mini-tutorial, I explain how to open the firewall for Samba.

General information:

Notes: With root privileges to run]
~# ufw enable (Enable the firewall)
~# ufw disable (Disable the firewall)
~# ufw default deny (First Blocks all network traffic)

Samba:

~# vi /etc/default/ufw
Following line:

# The nf_contrack_netbios_ns has been added
IPT_MODULES = "nf_conntrack_ftp nf_nat_ftp nf_conntrack_irc nf_nat_irc"
Following entry supplemented by a space before the quotation marks:
»Nf_conntrack_netbios_ns

It looks like this:

IPT_MODULES = "nf_conntrack_ftp nf_nat_ftp nf_conntrack_irc nf_nat_irc nf_conntrack_netbios_ns"

~# ufw allow proto udp from 10.10.10.0/24 to any port 137
~# ufw allow proto udp from 10.10.10.0/24 to any port 138
~# ufw allow proto tcp from 10.10.10.0/24 to any port 139
~# ufw allow proto tcp from 10.10.10.0/24 to any port 445

Explanation:
proto: Protocol, that is udp or tcp
from 10.10.10.0/24: All the addresses of my network so (10.10.10.1-255) access (IP address)
to any: Available at any address in my network (destination address)
port: The releasable Port
(Port-rank, there is so free: 55000:55050 - enabled the ports from 55,000 to 55,050)

To remove port created shares back to simply add "delete", type:

~# ufw delete allow proto udp from 10.10.10.0/24 to any port 137

No comments:

Post a Comment