General
cancel
Showing results for 
Search instead for 
Did you mean: 

Set-up SAMBA so can be accessed by two subnets

Frederick Maulion
Occasional Advisor

Set-up SAMBA so can be accessed by two subnets

Hi,

I am trying to configure a SAMBA server to be accessed both by 192.168.10.6 and 192.168.9.6 gateways but only using one ethernet card. Is this possible? Thanks.

PS

I tried IP aliasing but it doesn't seem to work or I missed something in the configuration. Am using Mandrake 8.1 by the way on a Kayak X2000.
8 REPLIES
Raymond van den Heuvel
Occasional Contributor

Re: Set-up SAMBA so can be accessed by two subnets

Hi,

As far as I know you can use "allow hosts=" in your smb.conf. Some examples:

1. allow hosts that match the given
network/netmask

hosts allow = 150.203.15.0/255.255.255.0

2. allow a couple of hosts

hosts allow = gataway1, gateway2

If you go to http://samba.nip.nl/samba/docs/man/smb.conf.5.html you will see an explenation. And these examples to. Or the smb.conf man page.

Greeting, Ray.
Okey that's it I quit ;op
I_M
Honored Contributor

Re: Set-up SAMBA so can be accessed by two subnets

Hi

In smb.conf [global] section,

add
interfaces = 192.168.10.6/24 192.168.9.6/24

thanks
Frederick Maulion
Occasional Advisor

Re: Set-up SAMBA so can be accessed by two subnets

I tried your suggestions. But whenever I restart SAMBA by "service smb restart", the NMB shutdown shows a failed status. What gives?
Marco Paganini
Respected Contributor

Re: Set-up SAMBA so can be accessed by two subnets

Hello,

Could you send us the relevant parts of NMB's logfile (under /var/log/samba)?

Regards,
Paga
Keeping alive, until I die.
Frederick Maulion
Occasional Advisor

Re: Set-up SAMBA so can be accessed by two subnets

This is what I got when I set
interfaces = 192.168.9.6/24 192.168.10.6/24
in the [globals] section of the smb.conf file.

2001/11/10 11:12:43, 0] lib/util_sock.c:open_socket_in(819)
bind failed on port 137 socket_addr=192.168.10.6 (Cannot assign requested address)
[2001/11/10 11:12:43, 0] nmbd/nmbd_subnetdb.c:make_subnet(142)
nmbd_subnetdb:make_subnet()
Failed to open nmb socket on interface 192.168.10.6 for port 137. Error was Cannot assign requested address
[2001/11/10 11:12:43, 0] nmbd/nmbd.c:main(835)
ERROR: Failed when creating subnet lists. Exiting.

During this time, the server cannot be seen by PCs on BOTH subnets.
Raymond van den Heuvel
Occasional Contributor

Re: Set-up SAMBA so can be accessed by two subnets

Have you tried adding

hosts allow = 192.168.10.6/255.255.255.0, 192.168.9.6/255.255.255.0 ???????????

And undone the chanes to interface??
Okey that's it I quit ;op
Raymond van den Heuvel
Occasional Contributor

Re: Set-up SAMBA so can be accessed by two subnets

Whoops typo, sorry

Have you tried adding

hosts allow = 192.168.10.0/255.255.255.0, 192.168.9.0/255.255.255.0 ???????????

And undone the chanes to interface??
Okey that's it I quit ;op
Mark Fenton
Esteemed Contributor

Re: Set-up SAMBA so can be accessed by two subnets

the interfaces line in smb.conf describes the address of the samba server that should listen for connections.

Unless your server has both of those address on it's nic(s), you won't be able to bind port 137 to them -- hence the error you're seeing.

Another friend of mine was running a server with addresses on two class C networks -- what worked for him was to "fake" a class B with netmask 255.255.0.0 (the two address differed only in the last two octets).

Samba can be wild, wonderful, and a bear to set up.