LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-09-2012, 06:55 PM   #1
edeamat
LQ Newbie
 
Registered: Mar 2009
Location: Lima Peru
Distribution: Centos
Posts: 17

Rep: Reputation: 2
Problem to configure samba with firewall debian


Hi everybody. I need your help as soon as possible. I have my debian firewall with iptables and i need to get access through samba server.

My global configuration in samba server seems like this:

Quote:
[global]
log file = /var/log/samba/log.%m
guest account = nobody
socket options = TCP_NODELAY IPTOS_LOWDELAY
obey pam restrictions = no
interfaces = 192.168.10.1
encrypt passwords = yes
#smb ports = 139
passdb backend = smbpasswd
smb passwd file = /etc/samba/smbpasswd
dns proxy = no
workgroup = fincyt
os level = 20
security = share
syslog = 0
panic action = /usr/share/samba/panic-action %d
max log size = 1000
bind interfaces only = true
allow hosts = 192.168.10.2
read raw = yes
write raw = yes
max xmit = 65535
dead time = 15
And my iptables rules are:

Quote:

iptables -A INPUT -p tcp --dport 139 -m state --state NEW -s 192.168.10.2/24-j ACCEPT
iptables -A INPUT -p tcp --dport 445 -m state --state NEW -s 192.168.10.2/24 -j ACCEPT
iptables -A INPUT -p udp --dport 137 -m state --state NEW -s 192.168.10.2/24 -j ACCEPT
iptables -A INPUT -p udp --dport 138 -m state --state NEW -s 192.168.10.2/24 -j ACCEPT
Thank you very much for your help.
 
Old 03-11-2012, 08:18 PM   #2
elfenlied
Member
 
Registered: Dec 2004
Posts: 83

Rep: Reputation: 8
See this link for the ports required and explanation http://troy.jdmz.net/samba/fw/.

Aside from that it appears in your smb.conf you only want host 192.168.10.2 to access this server so you should be using -s 192.168.10.2/32 in your iptables commands.
 
Old 03-13-2012, 03:36 PM   #3
edeamat
LQ Newbie
 
Registered: Mar 2009
Location: Lima Peru
Distribution: Centos
Posts: 17

Original Poster
Rep: Reputation: 2
Thanks a lot for the link elfenlied. However, I'm still stuck as this problem. I can´t get to connect to my samba server at all. When i look for the logs there is nothing to see......

Anye help would be appreciated.
 
Old 03-13-2012, 05:35 PM   #4
elfenlied
Member
 
Registered: Dec 2004
Posts: 83

Rep: Reputation: 8
Are you trying to connect to the samba server with a PC that has an IP address of 192.168.10.2?
 
Old 03-14-2012, 09:39 AM   #5
edeamat
LQ Newbie
 
Registered: Mar 2009
Location: Lima Peru
Distribution: Centos
Posts: 17

Original Poster
Rep: Reputation: 2
Hi elfenlied. My IP address is 192.168.10.2. I can't see any event in the logs at all.
 
Old 03-14-2012, 11:17 AM   #6
vp0619520
Member
 
Registered: Jan 2012
Posts: 55

Rep: Reputation: Disabled
What's your workgroup name in the Windows?I think udp don't have the 'state',so maybe you should change these iptables statements,and try again.
And is there any other iptables rules in the samba server?
 
Old 03-14-2012, 04:29 PM   #7
elfenlied
Member
 
Registered: Dec 2004
Posts: 83

Rep: Reputation: 8
Yes vp0619520 is right you should probably have both NEW and ESTABLISHED in your rules unless you have that somewhere else, the other thing I would try is turning off iptables for the moment. Verify that samba works then at least you know what it is that you have to fix to get it working.
 
Old 03-14-2012, 05:10 PM   #8
edeamat
LQ Newbie
 
Registered: Mar 2009
Location: Lima Peru
Distribution: Centos
Posts: 17

Original Poster
Rep: Reputation: 2
My workgroup is FINCYT. Sorry but i don't understand what you try to talk me. Could you give me more information.

The rules described before are in my iptables script which is located at my firewall.

Thank you.
 
Old 03-14-2012, 05:47 PM   #9
edeamat
LQ Newbie
 
Registered: Mar 2009
Location: Lima Peru
Distribution: Centos
Posts: 17

Original Poster
Rep: Reputation: 2
Sorry enfenlied. I did the same instructions as mention in this link http://troy.jdmz.net/samba/fw/.

Now, you can say that my rules should define as NEW and ESTABLISHED. I'm feeling a bit confused.

Thanks a lot.
 
Old 03-14-2012, 05:54 PM   #10
elfenlied
Member
 
Registered: Dec 2004
Posts: 83

Rep: Reputation: 8
Try stopping iptables first, and see if you can access your samba. If you can then it's likely to be a iptables problem, if not then it's possibly samba related.
 
Old 03-15-2012, 10:13 AM   #11
edeamat
LQ Newbie
 
Registered: Mar 2009
Location: Lima Peru
Distribution: Centos
Posts: 17

Original Poster
Rep: Reputation: 2
I can't stop iptables because the server is the firewall and forward all packages inside the network.
 
Old 03-22-2012, 06:24 PM   #12
edeamat
LQ Newbie
 
Registered: Mar 2009
Location: Lima Peru
Distribution: Centos
Posts: 17

Original Poster
Rep: Reputation: 2
Can anybody help me please with this issue?

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure Debian to use as a firewall karl29 Linux - Networking 1 02-19-2012 09:09 AM
LXer: How to install and Configure SAMBA in Debian Squeeze LXer Syndicated Linux News 0 02-26-2011 11:04 PM
Samba and firewall problem Hockeyfan Linux - Networking 3 12-10-2004 05:28 PM
how to configure redhat kde firewall to ONLY allow the samba roYal Fedora 2 04-09-2004 08:46 AM
How do I configure firewall for SAMBA? drwolfson Linux - Networking 4 11-05-2003 06:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration