Which ports and transports does SMB use, and what should an edge firewall do with TCP 445, 139 and UDP 443?
answer
- one TCP port for direct SMB
- an old NetBIOS session port
- QUIC rides a UDP port
- edge rule applies in both directions
- Windows Server 2025 firewall rules changed
basics
~20 sSMB uses direct TCP 445; NetBIOS over TCP 139 is the legacy transport; SMB over QUIC uses UDP 443. Block TCP 445 at the internet edge both inbound and outbound, and offer remote access with SMB over QUIC if needed.
solid answer
~40 sDirect TCP on port 445 carries every SMB 2 and 3 dialect. NetBIOS over TCP (session service on 139, RFC 1001 and 1002) is allowed by MS-SMB2 only for 2.0.2 to 3.0.2, and from Windows 11 24H2 and Windows Server 2025 the built-in firewall rules no longer open the NetBIOS ports 137 to 139 at all. SMB over QUIC, 3.1.1 only, listens on UDP 443 with TLS 1.3 and a server certificate; it is opt-in on the server and a Windows client tries TCP first. SMB Direct (RDMA) defaults to 5445. Microsoft's segmentation advice is to block TCP 445 (and the NetBIOS ports) inbound from the internet and outbound to it, inventory what really needs SMB, and not allow TCP 445 inbound to a file server you publish over QUIC.
go deeper
Recall that SMB uses TCP 445, that NetBIOS 139 is legacy, and that 445 must not be reachable from the internet.
Explain which dialects may use NetBIOS, what the 24H2 and Server 2025 firewall rules changed, and how SMB over QUIC differs.
Write the edge rules (445 both directions, UDP 443 only for a QUIC-published server) and defend each with Microsoft's guidance and an inventory.
Choose between publishing SMB over QUIC and a separate remote-access path, with the certificate and client-control burden stated.
## The transports MS-SMB2 defines | Transport | Port | Dialects | Notes | |---|---|---|---| | Direct TCP | TCP 445 | all SMB 2 and 3 dialects | a 4-byte header (a zero byte and a 3-byte length) precedes each SMB2 message | | NetBIOS over TCP | TCP 139 for the session service | 2.0.2, 2.1, 3.0, 3.0.2 only | RFC 1001 and 1002; not 3.1.1 | | SMB over QUIC | UDP 443 | 3.1.1 | TLS 1.3; the SMB2 protocol is identified by an application-layer protocol name ("smb") | | RDMA (SMB Direct) | 5445 by default | 3.0, 3.0.2, 3.1.1 | needs RDMA-capable hardware | Microsoft's documentation names the default ports for TCP, QUIC and RDMA as 445, 443 and 5445. The mechanics of QUIC itself belong to the leaf on HTTP/3 and QUIC; this question keeps SMB's use of the port. ## What changed for NetBIOS on Windows Microsoft's "secure SMB traffic" page says that in earlier Windows Server releases, creating a share made the built-in firewall automatically use inbound NetBIOS ports 137 to 139 (the File and Printer Sharing rules). **Beginning with Windows 11 24H2 and Windows Server 2025, the built-in rules do not contain the NetBIOS ports.** Microsoft says shares made with SMB 2 or later do not use ports 137 to 139 and that the ports were only needed for SMB1; if you need SMBv1 for legacy compatibility you must re-open them yourself. Read that as Windows's current behaviour: MS-SMB2 itself still describes NetBIOS over TCP for dialects up to 3.0.2, and a 3.1.1 client that meets it must reconnect over direct TCP. ## SMB over QUIC in practice - It is a **remote-access transport**: the server certificate creates a TLS 1.3 tunnel on UDP 443, so authentication and traffic inside it are not exposed to the underlying network. Microsoft calls it an "SMB VPN". - It is **opt-in**. A file server administrator enables it; a client cannot force a server to. - A Windows SMB client **still uses TCP by default** and attempts QUIC only if the TCP attempt fails or if you require it, with `New-SmbMapping -TransportType QUIC` or `NET USE /TRANSPORT:QUIC`. - Availability: every edition of Windows Server 2025, Windows Server 2022 Datacenter: Azure Edition, and Windows 11. The segmentation page's older wording says Azure Edition only; the QUIC page, updated 2025-07-24, is the more specific and newer, so follow it. - A QUIC server must be reachable on UDP 443, and Microsoft says explicitly: do not allow TCP/445 inbound to that file server. - The server can be told to listen on a different QUIC port with `New-SmbServerAlternativePort`; Microsoft says a Windows SMB server supports changing only the QUIC listening port. Clients can map to alternative TCP, QUIC or RDMA ports with `New-SmbMapping -TcpPort`, `-QuicPort` or `-RdmaPort`. ## What the firewall engineer writes 1. **Internet edge, inbound:** block TCP 445. Microsoft's reasoning: inbound SMB from the internet reaches devices inside the network. Microsoft's perimeter table also lists the NetBIOS ports TCP 139, UDP 137 and UDP 138 for the same edge rule. 2. **Internet edge, outbound:** block TCP 445 to the internet, unless a public cloud service you actually use requires it; if so, restrict it to that service's address ranges rather than to any host. 3. **Remote file access:** if staff need files from outside, publish SMB over QUIC on UDP 443 with its server certificate (and, optionally, client access control) rather than opening 445. 4. **Inside the network:** inventory what needs SMB, then use the Windows firewall templates. Why you segment at all, as a control choice, is a different question. 5. **NetBIOS:** do not re-open 137 to 139 unless a documented SMBv1-only device needs them. An example record for the change ticket, using documentation addresses: | Rule | Source | Destination | Port | Action | |---|---|---|---|---| | R1 | any | 203.0.113.0/24 (edge) | TCP 445, TCP 139, UDP 137 and 138 | deny | | R2 | 192.0.2.0/24 (branch) | any | TCP 445, TCP 139, UDP 137 and 138 | deny | | R3 | any | files01.example.internal (198.51.100.10) | UDP 443 | allow, QUIC only | ## Traps - Blocking only inbound 445 leaves outbound SMB open; Microsoft recommends both. - UDP 443 is not TCP 443: web traffic rules do not cover it. - Microsoft's firewall template "Block all inbound SMB 445" says it is not to be applied to computers that host SMB shares, so it belongs on workstations, not on your file server. - A client can map to a non-default TCP, QUIC or RDMA port only if the server listens there; rules written for 445 do not cover it.
- On Windows Server 2025, what happens to a file server's NetBIOS ports when you create a share?Nothing opens automatically any more. Microsoft says the built-in firewall rules from Windows 11 24H2 and Windows Server 2025 no longer contain the SMB NetBIOS ports, and earlier releases opened inbound 137 to 139 in the File and Printer Sharing rules. Re-adding them is a deliberate change, justified only by an SMBv1-only device.
- What do you tell a user who wants to reach files from home through SMB over QUIC but whose network blocks UDP 443?SMB over QUIC uses UDP 443 by default, so a network that drops it will fail unless the server was given an alternative QUIC port with New-SmbServerAlternativePort and the client maps with New-SmbMapping -QuicPort. A Windows client tries TCP first and only uses QUIC when TCP fails or when told to.
- A QUIC-published file server still answers on TCP 445 from the internet. What is wrong?The firewall is too open. Microsoft's QUIC guidance says to allow UDP 443 inbound and not to allow TCP 445 inbound to the file server. Publishing both defeats the point of the QUIC tunnel; remove the TCP 445 allow rule.
- SMB 3.1.1 can still run over NetBIOS port 139
- SMB over QUIC uses TCP 443 like web traffic
- Block 445 inbound only; outbound is fine
- A Windows client tries QUIC before TCP
- SMB over QUIC is on by default in Windows Server 2025