Iptables rule for windows file sharing?

Dale Sykora dalen at czexan.net
Fri Jan 28 19:02:27 UTC 2005


cjlesh wrote:
> Hey all:
> 
> I have a laptop running Fedora Core 3 and a dekstop with Widows XP, both connected via a Linksys router.
> 
> I am trying to figure out a way to allow the laptop 'see' the shared directories on the Windows machine. If I disable the Fedora firewall, it works. 
> 
> I would like to do this without disabling the firewall.
> A google search turns up to following command:
> 
> iptables -A INPUT -p ALL -i eth0 -s 192.168.0.1 --destination-port 137:139 -j ACCEPT
> 
> however this results in an error.
> 
> Any help on a reasonable firewall rule to allow windows share traffic on my local network only?
> 
> -cjl
> 
> 
> 
> 
I remember having to open port 445 also.
Here is what worked for me from /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -p udp --dport 137:138 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp --dport 139 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp --dport 445 -j ACCEPT




More information about the users mailing list