DavidDecotigny

Blog-20090511181812-info

Navigation

  • Rechercher un mot :

iptables rules for samba


My ubuntu laptop could not "reach" the windows network (via smb). It was because of my firewall. The following lines need to be added to the firewall script:
/sbin/modprobe nf_conntrack_netbios_ns
/sbin/iptables -A FILT -p udp --dport 137:138 -j ACCEPT
/sbin/iptables -A FILT -p tcp --dport 139 --syn -j ACCEPT
/sbin/iptables -A FILT -p tcp --dport 445 --syn -j ACCEPT

(where FILT is my filtering chain plugged onto INPUT).

If you use ufw, you will need to add nf_conntrack_netbios_ns to the IPT_MODULES variable in /etc/default/ufw. The other rules should be fairly easy to translate into ufw wording.