To close the samba port used by smbd, you need to use these rules
- Code: Select all
iptables -A INPUT -p udp -m udp --dport 139 -j REJECT
iptables -A INPUT -p udp -m udp --dport 445 -j REJECT
To open them again, uses the delete rules
- Code: Select all
iptables -D INPUT -p udp -m udp --dport 139 -j REJECT
iptables -D INPUT -p udp -m udp --dport 445 -j REJECT
Attention: Do not close the port 137 and 138 which are used by nmbd. If they are closed, your nas will not be visible on your LAN :whistle
After each rebooting you need to run these commands.
Please to note as long as you do not forward these ports on your router, samba access from WAN is closed. So for me these rules are useless unless you think some hosts on your LAN may be infected...
Note: I moved the topics to ISP1/EDmini forum as it is your platform type