這種模式類似網站主機的虛擬主機——一個網站主機可以對應多個網站。
案例說明:
主機名稱:server1
主機別名:serverA、serverB
使用網路芳鄰連到serverA、serverB時分別可以看到shareA、shareB
smb.conf
----------------------------------------------------------------------------------------------------------
[global]
workgroup = group1
netbios name = server1
smb ports = 139 <-------使用139 port %L 才有作用,如果不用%L include不同設定, 也可以用 %i (IP address),那就要加
bind interfaces only = True 和設定interfacenetbios aliases = serverA, serverB
include = /etc/samba/smb-%L.conf
---------------------------------------------------------------------------------------------------------
smb-serverA.conf
--------------------------------------------------------------------------------------------------------
[global] <-----------------如果有加所有在smb.conf的設定都失效,如果不加只要設定想變更的參數
workgroup = groupA
netbios name = serverA
[shareA]
path = /export/pathA
------------------------------------------------------------------------------------------------------
smb-serverB.conf
--------------------------------------------------------------------------------------------------------
<------不加gloabl會套用smb.conf的設定
smb ports = 445 139
workgroup = groupB
netbios name = serverB
[shareB]
path = /export/pathB
------------------------------------------------------------------------------------------------------
smb-server1.conf <-----------------也可以不設
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
沒有留言:
張貼留言