[Samba] Binding to a local IP address when mounting smb file
greearb at candelatech.com
Fri Jul 14 23:05:38 GMT 2006
I have completed the first draft of the patch to allow binding to
local addresses. Many of the binaries do not fully support this
option since I did not know a clean way to get the config info to them,
didn't think it was really required for my needs. As far as I can tell,
the libraries are well supported, so the applications can have support
added as needed. smbmount and a few others *do* support the new options,
and I have tested that smbmount works as I had hoped.
The attached patch enables this behaviour:
SMB client machine:
eth0 IP: 18.104.22.168 netmask 255.255.255.0
eth1 IP: 22.214.171.124 netmask 255.255.255.0
eth2 IP: 126.96.36.199 netmask 255.255.255.0
local mount dirs:
SMB server is exporting share 'samba'
I want to stress the SMB server as if many SMB clients are connecting.
I can make arbitrarily many of the (virtual) interfaces on the client,
but when mounting the SMB server, I want each mount point to use a specific
interface and local IP.
With my patch applied, I can bind the smbmount process to a particular
local IP and device:
smbmount //188.8.131.52/samba /mnt/smb2 -o local_dev=eth1,local_ip=184.108.40.206,username=lanforge,password=lanforge
smbmount //220.127.116.11/samba /mnt/smb3 -o local_dev=eth2,local_ip=18.104.22.168,username=lanforge,password=lanforge
As far as I can tell, the server treats each of the mounts as separate entities,
accomplishing my goal.
I would like to see this patch included in the official samba code, and would
like your feedback on any changes needed to make that happen.
I already know that I need to get rid of some of the debugging 'printf' statements,
and will do that when the rest of the issues have been addressed.
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc http://www.candelatech.com
More information about the samba