You are not logged in.

#1 2011-07-31 22:48:17

jlacroix
Member
Registered: 2009-08-16
Posts: 576

[SOLVED] Samba IP Ranges

Hello, just a quick question I'm sure one or more of you could nail pretty quickly. I am looking to shorten the entries in my samba configuration files. Here is an example:

[Music] ; user="jlacroix"
    force user = jlacroix
    path = /home/jlacroix/Music
    writable = no
    public = yes
        hosts allow = 172.16.254.10 172.16.254.11 172.16.254.12 172.16.254.13 172.16.254.14 172.16.254.15 172.16.254.16 172.16.254.17 172.16.254.18 172.16.254.19 127.0.0.1

The IP ranges under "hosts allow" is kinda long. Can I shorten that, and make it a range of some sort instead of listing each IP address I want to allow? I Googled this, and didn't find it. Perhaps my search skills suck.

Last edited by jlacroix (2011-08-01 00:03:24)

Offline

#2 2011-07-31 23:03:06

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED] Samba IP Ranges

This is about as small as you can make it, using CIDR masks:

172.16.254.10/31
172.16.254.12/30
172.16.254.16/30
127.0.0.1

I'm not sure if Samba supports ranges in the config file; you can easily try:

172.16.254.10-172.16.254.19 127.0.0.1

Offline

#3 2011-08-01 00:03:09

jlacroix
Member
Registered: 2009-08-16
Posts: 576

Re: [SOLVED] Samba IP Ranges

fukawi2 wrote:

This is about as small as you can make it, using CIDR masks:

172.16.254.10/31
172.16.254.12/30
172.16.254.16/30
127.0.0.1

I'm not sure if Samba supports ranges in the config file; you can easily try:

172.16.254.10-172.16.254.19 127.0.0.1

That didn't work, looks like this isn't possible. sad

Thanks though!

Offline

#4 2011-08-01 07:02:43

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED] Samba IP Ranges

jlacroix wrote:

That didn't work, looks like this isn't possible. sad

I didn't think it would support ranges, and I just had a look at the man page and it doesn't look to support CIDR either, so correction to my last would be:

172.16.254.10/255.255.255.254
172.16.254.12/255.255.255.252
172.16.254.16/255.255.255.252
127.0.0.1

Doesn't really make it much shorter like that though sad

EDIT: too many dots

Last edited by fukawi2 (2011-08-01 07:02:57)

Offline

#5 2011-08-01 12:54:54

jlacroix
Member
Registered: 2009-08-16
Posts: 576

Re: [SOLVED] Samba IP Ranges

Thank you for your help, that doesn't make it much shorter. I wonder why they don't include a feature like this by default? I bet a lot of people could use it.

Offline

Board footer

Powered by FluxBB