Configure Samba to Bind to Specific Interfaces: Difference between revisions

From SambaWiki
(New page "Configure Samba to Bind to Specific Interfaces" to avoid duplicate content.)
 
m (Added tags)
Line 1: Line 1:
If your Server uses multiple network interfaces, you can configure Samba to bind to specific interfaces only. For example, if Samba is installed on a router with one network interface connected to the internet and one to the internal network.
If your Server uses multiple network interfaces, you can configure Samba to bind only to specific interfaces. For example, if Samba is installed on a router with one network interface connected to the internet and one to the internal network.


To bind all Samba services to the "eth0" and the "loopback" (lo) device:
To bind all Samba services to the <code>eth0</code> and the <code>loopback</code> (<code>lo</code>) device:


* Add the following parameters to the [global] section of your "smb.conf" file:
* Add the following parameters to the <code>[global]</code> section of your <code>smb.conf</code> file:


bind interfaces only = yes
bind interfaces only = yes
interfaces = lo eth0
interfaces = lo eth0


:The "interfaces" parameter enables you to use alternative values, such as IP addresses instead of device names. For further details, see the "smb.conf" (5) man page.
:The <code>interfaces</code> parameter enables you to use alternative values, such as IP addresses instead of device names. For further details, see the <code>smb.conf (5)</code> man page.


: Note that you should always enable Samba to listen on the loopback (lo) devices. Several utilities connect to the loopback IP if no host name is provided.
: Note that you should always enable Samba to listen on the <code>loopback</code> (<code>lo</code>) devices. Several utilities connect to the loopback IP if no host name is provided.


* Restart the Samba service(s).
* Restart the Samba service(s).

Revision as of 21:26, 9 October 2016

If your Server uses multiple network interfaces, you can configure Samba to bind only to specific interfaces. For example, if Samba is installed on a router with one network interface connected to the internet and one to the internal network.

To bind all Samba services to the eth0 and the loopback (lo) device:

  • Add the following parameters to the [global] section of your smb.conf file:
bind interfaces only = yes
interfaces = lo eth0
The interfaces parameter enables you to use alternative values, such as IP addresses instead of device names. For further details, see the smb.conf (5) man page.
Note that you should always enable Samba to listen on the loopback (lo) devices. Several utilities connect to the loopback IP if no host name is provided.
  • Restart the Samba service(s).