I don't use Samba that often so my knowledge is a bit 'sketchy' on it however, there are two different ways to use connect via the SMB protocol. If all your Windows machines run Win2K or above then you should be able to use/open port 445 for both TCP and UDP. Older Windows systems require UDP ports 137 and 138 plus TCP ports 138 and 139, so your rules are slightly wrong.
Where are you adding these rules? if it's after you have run the script and you are adding rules via the commandline they will never be processed by iptables as the last rule within the script essentially just reinforces the DROP policy. You will need to either remove the lat rule from the script or from the commandline insert the rules prior to the last rule (read up on iptables syntax for inserting/adding new rules to an already existant ruleset).
If you can run on port 445 (UDP and TCP) then the script itself is relatively easily adjusted to cater for this.
iptables question (ip address)
Moderator: General Moderators