LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-18-2004, 07:37 PM   #1
captain-cat
LQ Newbie
 
Registered: Jun 2004
Location: UK
Distribution: Fedora-C2
Posts: 27

Rep: Reputation: 15
iptables and samba


hi, i ll cut to the point. i am trying to configure my linux for file sharing with win xp machines through samba. the network is through a router/firewall. from the forums i found that ports 137,138,139 must be open. i am using the following found in the forums:

$ iptables -A INPUT -s 192.168.0.0/24 -p tcp -i eth0 --destination-port 137:139 -m state --state NEW -j ACCEPT

but it doesnt work. if i flush my iptables the win machines have access. any help?

furthermore, if i have iptables i cannot see the other win machines. if i flush the iptables again everything works fine. any solution to that one as well?

thanks

Last edited by captain-cat; 07-18-2004 at 07:49 PM.
 
Old 07-18-2004, 08:12 PM   #2
osvaldomarques
Member
 
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519

Rep: Reputation: 34
Hi Captain-cat,

Your firewall rule has just one leg. For your computer talk with your local network you need to accept rules for INPUT as you already did but must have the same rules for OUTPUT.
If your machine is not the firewall, you can run it without firewall rules. The rules must be on your firewall. I recommend you to not accept these ports from the internet. The smb protocol is very insecure and you will be subject to worm attacks. Think the firewall as the main door of your home. Whenever somebody knocks, you first look to see if is somebody you know before open the door. If you don't know the subject you may alert him you will not permit him to enter or, pretend there is nobody at home. But all the access must be across this door. Inside home, all the doors are open because who is there are relatives.
For deeper knowledge and scripts for firewall rules, see www.netfilter.org.
 
Old 07-18-2004, 09:22 PM   #3
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
You need to open those ports for TCP and UDP.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Iptables and Samba MrBiggZ Linux - Security 1 10-08-2005 02:20 PM
iptables and samba shankariyer Linux - Security 1 02-18-2004 01:26 AM
Samba and iptables TheRealDeal Linux - Networking 3 09-22-2003 10:13 AM
using iptables to allow samba robertmarkbram Linux - Networking 3 08-17-2003 03:08 AM
iptables and Samba frkstein Linux - Networking 2 09-19-2002 09:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:35 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration