Windows File Sharing at LAN environment is common and it is using chatty NetBIOS protocol. NetBIOS is broadcast based(Non-routed) protocol. So, if you are on WAN or WLAN, how you get file sharing function? Answer is SMB.
The following ports are associated with file sharing and server message block (SMB) communications:
- Microsoft file sharing SMB: User Datagram Protocol (UDP) ports from 135 through 139 and Transmission Control Protocol (TCP) ports from 135 through 139.
- UDP 137 – NetBIOS Name Resolution
- UDP 138 – NetBIOS Datagram transmission and reception
- TCP 139 – NetBIOS Session Service
- Direct-hosted SMB traffic without a network basic input/output system (NetBIOS): port 445 (TCP and UPD).
You need to allow, TCP/UDP port 445 for SMB traffic from firewall
and \\[ip address x.x.x.x] \ [Sharing folder name]
Client side
- If NetBT is enabled, client try both port 139 and 445 simultaneously.
– If client got response from port 445(SMB), it sends a RST to port 139, and it’s SMB session to port 445 only.
– If client doesn’t get response from port 445, it will continuously SMB session to port 139 only.
– If no response from both of ports, a session will be failed.
– If NetBT is disabled, client will always try to connect to the server with port 445 only.
Server side
- If NetBT is enabled, the server listens on UDP ports 137, 138, and on TCP ports 139, 445.
- If NetBT is disabled, the server listens on TCP port 445 only.