SkillPilotAI

Windows networking concepts

Windows networking concepts explain how office PCs handle login, name resolution and file sharing: workgroup vs domain with Active Directory, legacy NetBIOS/WINS vs DNS, SMB, the Public/Private/Domain firewall profiles, and netsh vs PowerShell.

197.1 Workgroup vs domain

  • Workgroup: peer to peer; every PC keeps its own local users, so Asha's account must be created on each PC. Fine for home or a small office.
  • If PC 3 has no local account for Asha, she gets access denied there.
  • Domain: a central Domain Controller (DC); all PCs join it, the DC checks passwords and issues Kerberos tickets.
  • With one ticket Asha can open shares on any domain PC, because they all trust the same DC.
Domain login with a Kerberos ticket
  1. 1.Office grows to 200 PCs; a Domain Controller (Active Directory) is added

  2. 2.All PCs join the domain

  3. 3.Asha logs in on PC 2; the DC checks her password

  4. 4.DC gives her a Kerberos ticket

  5. 5.Asha opens a folder on PC 3 over SMB by showing the ticket

  6. 6.PC 3 trusts the same DC, so access is OK

PointWorkgroupDomain
Userslocal on every PCcentral in Active Directory
Login checkeach PC itselfDC (Kerberos)
Policyper PCGroup Policy for all joined PCs
Scalehome / small officetens to thousands of PCs

197.2 Active Directory

  • Runs on the DC; stores users, computers and groups in one place.
  • OUs organise objects like folders; Group Policy applies one setting to all joined PCs.
  • A DC runs LDAP, Kerberos and DNS together (details in the directory video).

197.3 Names: NetBIOS broadcast vs WINS vs DNS

Finding FILESRV's IP
  1. 1.Asha's laptop needs FILESRV's IP

  2. 2.NetBIOS name service broadcasts 'who is FILESRV?' on UDP 137

  3. 3.Switch floods it; only FILESRV replies with 192.168.217.10

  4. 4.Router stops the broadcast, so other subnets cannot be reached

  5. 5.WINS: laptop sends a unicast query to the central NetBIOS name server, works across routers

  6. 6.Today both are legacy: Microsoft says replace WINS with DNS

  • SMB is the Windows file/printer sharing protocol, today on TCP 445.
  • Old SMB ran over NetBIOS: UDP 137 (names), UDP 138 (datagrams), TCP 139 (sessions) = the NetBIOS ports.
  • SMB1 is not installed by default today.

197.4 Network profiles: Public, Private, Domain

ProfileWhenBehaviour
Publicairport, cafe, unknown Wi-FiPC hidden, file sharing blocked: strictest
Privatehome / trusted networkPC discoverable, sharing can be turned on
Domain (DomainAuthenticated)laptop can authenticate to its domain's DCapplied automatically; you cannot select it
Public profile blocks SMB
  1. 1.Laptop joins a new Wi-Fi; Windows assigns a profile

  2. 2.Firewall applies rules for that profile

  3. 3.Profile is Public: PC hidden on the network

  4. 4.Unknown device tries TCP 445 on the laptop

  5. 5.Firewall drops it right there

197.5 netsh vs PowerShell

  • netsh: older tool, text commands in contexts (advfirewall, interface, wlan; interface has ipv4, ipv6, portproxy ...).
  • PowerShell cmdlets (Set-NetFirewallRule, Set-NetConnectionProfile ...) return objects you can filter in a pipeline; Microsoft recommends them now.
  • Only generic help commands were run on the office domain PC (no names or IPs shown).
PowerShell
netsh /?netsh interface /?Get-Command -Module NetTCPIP | Measure-Object(Get-Help Set-NetConnectionProfile).Synopsis
Output
$ netsh interface /?tcp            - Changes to the `netsh interface tcp' context.$ Get-Command -Module NetTCPIP | Measure-ObjectCount    : 34$ (Get-Help Set-NetConnectionProfile).SynopsisSet-NetConnectionProfile [-Name <string[]>]  [-InterfaceAlias <string[]>]  [-InterfaceIndex <uint32[]>]  [-NetworkCategory <NetworkCategory>]  [-AsJob] [-PassThru] [-WhatIf] [-Confirm]
  • Set-NetConnectionProfile -NetworkCategory can set only Public or Private; DomainAuthenticated comes automatically.
Output
# netsh (Command Prompt)netsh advfirewall set allprofiles state onnetsh advfirewall firewall set rule name="Allow Web 80" new remoteip=192.168.0.2# PowerShellSet-NetFirewallProfile -Profile Domain,Public,Private -Enabled TrueSet-NetFirewallRule -DisplayName "Allow Web 80" -RemoteAddress 192.168.0.2# network profile (docs example, not run)Set-NetConnectionProfile -InterfaceAlias Ethernet1 -NetworkCategory "Public"
JobnetshPowerShell
Firewall on for all profilesnetsh advfirewall set allprofiles state onSet-NetFirewallProfile -Profile Domain,Public,Private -Enabled True
Change rule remote IPnetsh advfirewall firewall set rule name=... new remoteip=...Set-NetFirewallRule -DisplayName ... -RemoteAddress ...
Outputtextobjects (pipeline)

197.6 Practical: Samba workgroup lab

  • Docker network 192.168.217.0/24 with a Samba server FILESRV and a client. Samba = open-source SMB + NetBIOS on Linux.
  • testparm: server role standalone, workgroup OFFICE, WINS support on. nmbd listens on UDP 137/138, smbd on TCP 139/445.
Terminal
testparm -snetstat -lnunetstat -lntnmblookup FILESRVnmblookup -U 192.168.217.10 --recursion FILESRVnmblookup -A 192.168.217.10smbclient -L FILESRV -U asha%LabPass197
Output
$ netstat -lnuudp  0  0 192.168.217.10:137  0.0.0.0:*udp  0  0 192.168.217.10:138  0.0.0.0:*$ netstat -lnttcp  0  0 192.168.217.10:445  0.0.0.0:*  LISTENtcp  0  0 192.168.217.10:139  0.0.0.0:*  LISTEN
  • nmblookup FILESRV resolves by broadcast to 192.168.217.10; -U ... --recursion sends a unicast query to WINS.
  • -A shows node status: FILESRV and group OFFICE registered; H = hybrid node (asks WINS first, then broadcast).
Output
$ nmblookup -A 192.168.217.10Looking up status of 192.168.217.10  FILESRV   <00> -         H <ACTIVE>  FILESRV   <20> -         H <ACTIVE>  OFFICE    <00> - <GROUP> H <ACTIVE>  OFFICE    <1e> - <GROUP> H <ACTIVE>
Output
$ smbclient -L FILESRV -U asha%LabPass197  Sharename       Type      Comment  ---------       ----      -------  docs            Disk      Team documents  public          Disk      Public files  IPC$            IPC       IPC Service (N197 lab file server)SMB1 disabled -- no workgroup available
  • docs and public are disk shares, IPC$ is a hidden service share. 'SMB1 disabled -- no workgroup available': NetBIOS browsing is legacy.

197.7 Common mistakes

  • Thinking Private is safer because of its name: Public is the strictest. Cafe = Public, home = Private.
  • Expecting the Domain profile at home without VPN: the DC is unreachable, so it is Private or Public.
  • Relying on NetBIOS/WINS for names in new networks instead of DNS.
  • Leaving SMB1 or ports 137-139 open when only 445 is needed.

197.8 Interview tips

  • Workgroup = peer to peer, local users, no central control; domain = AD DC, central users and Group Policy, Kerberos login.
  • SMB uses TCP 445; NetBIOS ports are UDP 137, 138 and TCP 139.
  • Domain profile is applied only when the DC is reachable; Set-NetConnectionProfile sets only Public/Private.
  • WINS is a central NetBIOS name DB; replace it with DNS.
  • Prefer PowerShell cmdlets over netsh for scripting.