2004-02-14 19:06:39 +01:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
|
|
|
<article>
|
|
|
|
<!--$Id$-->
|
|
|
|
|
|
|
|
<articleinfo>
|
|
|
|
<title>Samba/SMB</title>
|
|
|
|
|
|
|
|
<authorgroup>
|
|
|
|
<author>
|
|
|
|
<firstname>Tom</firstname>
|
|
|
|
|
|
|
|
<surname>Eastep</surname>
|
|
|
|
</author>
|
|
|
|
</authorgroup>
|
|
|
|
|
2005-04-16 00:22:36 +02:00
|
|
|
<pubdate>2005-04-14</pubdate>
|
2004-02-14 19:06:39 +01:00
|
|
|
|
|
|
|
<copyright>
|
|
|
|
<year>2002</year>
|
|
|
|
|
|
|
|
<year>2004</year>
|
|
|
|
|
2005-01-17 16:58:26 +01:00
|
|
|
<year>2005</year>
|
|
|
|
|
2004-02-14 19:06:39 +01:00
|
|
|
<holder>Thomas M. Eastep</holder>
|
|
|
|
</copyright>
|
|
|
|
|
|
|
|
<legalnotice>
|
|
|
|
<para>Permission is granted to copy, distribute and/or modify this
|
|
|
|
document under the terms of the GNU Free Documentation License, Version
|
|
|
|
1.2 or any later version published by the Free Software Foundation; with
|
|
|
|
no Invariant Sections, with no Front-Cover, and with no Back-Cover
|
|
|
|
Texts. A copy of the license is included in the section entitled
|
2005-01-17 16:58:26 +01:00
|
|
|
<quote><ulink url="GnuCopyright.htm">GNU Free Documentation
|
|
|
|
License</ulink></quote>.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
</legalnotice>
|
|
|
|
</articleinfo>
|
|
|
|
|
|
|
|
<para>If you wish to run Samba on your firewall and access shares between
|
|
|
|
the firewall and local hosts, you need the following rules:</para>
|
|
|
|
|
|
|
|
<para><emphasis role="bold">/etc/shorewall/rules:</emphasis><programlisting>#ACTION SOURCE DEST PROTO DEST PORT(S) SOURCE
|
|
|
|
# PORT(S)
|
|
|
|
ACCEPT fw loc udp 137:139
|
|
|
|
ACCEPT fw loc tcp 137,139,445
|
|
|
|
ACCEPT fw loc udp 1024: 137
|
|
|
|
ACCEPT loc fw udp 137:139
|
|
|
|
ACCEPT loc fw tcp 137,139,445
|
|
|
|
ACCEPT loc fw udp 1024: 137</programlisting></para>
|
|
|
|
|
2005-01-17 16:58:26 +01:00
|
|
|
<para>Users running Shorewall 2.0.0 or later may simpify the above through
|
|
|
|
use of the <firstterm>AllowSMB</firstterm> <ulink
|
2005-01-26 00:37:01 +01:00
|
|
|
url="Actions.html">action</ulink>:</para>
|
2005-01-17 16:58:26 +01:00
|
|
|
|
|
|
|
<programlisting>#ACTION SOURCE DEST PROTO DEST PORT(S) SOURCE
|
|
|
|
# PORT(S)
|
|
|
|
AllowSMB fw loc
|
|
|
|
AllowSMB loc fw</programlisting>
|
|
|
|
|
2004-02-14 19:06:39 +01:00
|
|
|
<para>To pass traffic SMB/Samba traffic between zones Z1 and Z2:</para>
|
|
|
|
|
|
|
|
<para><emphasis role="bold">/etc/shorewall/rules:</emphasis><programlisting>#ACTION SOURCE DEST PROTO DEST PORT(S) SOURCE
|
|
|
|
# PORT(S)
|
|
|
|
ACCEPT Z1 Z2 udp 137:139
|
|
|
|
ACCEPT Z1 Z2 tcp 137,139,445
|
|
|
|
ACCEPT Z1 Z2 udp 1024: 137
|
|
|
|
ACCEPT Z2 Z1 udp 137:139
|
|
|
|
ACCEPT Z2 Z1 tcp 137,139,445
|
|
|
|
ACCEPT Z1 Z1 udp 1024: 137</programlisting></para>
|
|
|
|
|
2005-01-17 16:58:26 +01:00
|
|
|
<para>Again, users running 2.0.0 or later may write:</para>
|
|
|
|
|
|
|
|
<programlisting>#ACTION SOURCE DEST PROTO DEST PORT(S) SOURCE
|
|
|
|
# PORT(S)
|
|
|
|
AllowSMB Z1 Z2
|
|
|
|
AllowSMB Z2 Z1</programlisting>
|
|
|
|
|
2004-02-14 19:06:39 +01:00
|
|
|
<para>To make network browsing (<quote>Network Neighborhood</quote>) work
|
|
|
|
properly between Z1 and Z2 requires a Windows Domain Controller and/or a
|
2005-04-16 00:22:36 +02:00
|
|
|
WINS server. I have run Samba on my firewall to handle browsing between two
|
|
|
|
zones connected to my firewall.</para>
|
|
|
|
|
|
|
|
<para>When debugging Samba/SMB problems, I recommend that you do the
|
|
|
|
following:</para>
|
|
|
|
|
|
|
|
<orderedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>Copy <filename>action.Drop</filename> and
|
|
|
|
<filename>action.Reject</filename> from <filename
|
|
|
|
class="directory">/usr/share/shorewall</filename> to <filename
|
|
|
|
class="directory">/etc/shorewall</filename>.</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Edit the copies and remove the <emphasis
|
|
|
|
role="bold">DropSMB</emphasis> and <emphasis
|
|
|
|
role="bold">RejectSMB</emphasis> lines.</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para><command>shorewall restart</command></para>
|
|
|
|
</listitem>
|
|
|
|
</orderedlist>
|
|
|
|
|
|
|
|
<para>The above steps will cause SMB traffic that is dropped or rejected by
|
|
|
|
policy to be logged rather than handled silently.</para>
|
|
|
|
|
|
|
|
<para>You can just remove the copies and <command>shorewall
|
|
|
|
restart</command> when you are finished debugging.</para>
|
2004-02-14 19:06:39 +01:00
|
|
|
</article>
|