Use this when IPsec rules protect traffic between computers.
Connection Security Rules
Connection security rules in Windows Firewall use IPsec to authenticate and optionally encrypt traffic between computers, such as requiring Kerberos-authenticated connections to servers or domain isolation.
1. Get-NetIPsecRule.
2. Main mode/quick mode SAs: Get-NetIPsecMainModeSA, Get-NetIPsecQuickModeSA.
3. Authentication method matches on both sides.
4. Firewall rules requiring secure connections.
5. Test.
connection security rule → IPsec negotiation → protected traffic
Context & applicabilityCommon mistakes · platform/version boundaries
- Requiring IPsec before all peers support it, breaking connectivity.
- Certificates for authentication missing on some hosts.
- Exempting too much traffic, so the rule protects little.
Operational reference
Fast context before you go deeper.
Get-NetIPsecRuleVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
Get-NetIPsecRule
Get-NetIPsecMainModeSA
Get-NetIPsecQuickModeSA
Security associations appear after traffic matches a rule. Failures are logged in the Security log (events 4650–4654, 4976–4984) when IPsec auditing is enabled.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Connection security rules use IPsec to authenticate or encrypt.
- Domain isolation requires authenticated connections.
- Both sides need matching rules.
Get-NetFirewallProfile— profiles, enabled, default actions, loggingGet-NetFirewallRule -Enabled True -Direction Inbound— enabled inbound rulesGet-NetFirewallRule -DisplayName '<name>' | Get-NetFirewallPortFilter— ports of a rulenetsh advfirewall monitor show firewall— effective state
ReferenceWhy it matters1 section · depth on demand
Using IPsec rules
Connection security rules require authentication (Kerberos, certificates) and optionally encryption between hosts — for example "only domain computers may connect to the database server". Monitor with Get-NetIPsecMainModeSA / Get-NetIPsecQuickModeSA and the *Monitoring → Security Associations* view in wf.msc. Start with "request authentication" before "require" to avoid outages.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Connection Security Rules configure IPsec: authenticate (and optionally encrypt) traffic between hosts, e.g. require Kerberos-authenticated IPsec for management ports so only domain machines can connect (domain isolation).
New-NetIPsecRule -DisplayName 'Require auth to servers' -InboundSecurity Require -OutboundSecurity Request -RemoteAddress 10.0.20.0/24 -Phase1AuthSet (Get-NetIPsecPhase1AuthSet -DisplayName 'ComputerKerberos').Name
Get-NetIPsecMainModeSA; Get-NetIPsecQuickModeSA
Combine with firewall rules using "Allow the connection if it is secure" and authorised computers/users.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Windows Firewall → Connection Security Rules. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/ · confidence 94%