大网数据广告活动
网络与域名解析

Transport Mode

· 52CE 我爱测

The Transport Mode IPsec policy scenario requires IPsec transport mode protection for all matching traffic.

The Transport Mode IPsec policy scenario requires IPsec transport mode protection for all matching traffic. Any matching clear text traffic is dropped until the IKE or AuthIP negotiation has completed successfully. If the negotiation fails, connectivity with the corresponding IP address will remain broken.

An example of a possible Transport Mode scenario is "Secure all unicast data traffic, except ICMP, using IPsec transport mode."

To implement this example programmatically, use the following WFP configuration.

At FWPM_LAYER_IKEEXT_V{4|6} setup MM negotiation policy

  1. Add one or both of the following MM policy provider contexts.

    • For IKE, a policy provider context of type FWPM_IPSEC_IKE_MM_CONTEXT.
    • For AuthIP, a policy provider context of type FWPM_IPSEC_AUTHIP_MM_CONTEXT.

    [!Note]
    A common keying module will be negotiated and the corresponding MM policy will be applied. AuthIP is the preferred keying module if both IKE and AuthIP are supported.

  2. For each of the contexts added in step 1, add a filter with the following properties.

    Filter property Value
    Filtering conditions Empty. All traffic will match the filter.
    providerContextKey GUID of the MM provider context added in step 1.

At FWPM_LAYER_IPSEC_V{4|6} setup QM and EM negotiation policy

  1. Add one or both of the following QM transport mode policy provider contexts.

    • For IKE, a policy provider context of type FWPM_IPSEC_IKE_QM_TRANSPORT_CONTEXT.
    • For AuthIP, a policy provider context of type FWPM_IPSEC_AUTHIP_QM_TRANSPORT_CONTEXT. This context can optionally contain the AuthIP Extended Mode (EM) negotiation policy.

    [!Note]
    A common keying module will be negotiated and the corresponding QM policy will be applied. AuthIP is the preferred keying module if both IKE and AuthIP are supported.

  2. For each of the contexts added in step 1, add a filter with the following properties.

    Filter property Value
    Filtering conditions Empty. All traffic will match the filter.
    providerContextKey GUID of the QM provider context added in step 1.

At FWPM_LAYER_INBOUND_TRANSPORT_V{4|6} setup inbound per-packet filtering rules

  1. Add a filter with the following properties.

    Filter property Value
    FWPM_CONDITION_IP_LOCAL_ADDRESS_TYPE filtering condition NlatUnicast
    action.type FWP_ACTION_CALLOUT_TERMINATING
    action.calloutKey FWPM_CALLOUT_IPSEC_INBOUND_TRANSPORT_V{4|6}
  2. Exempt ICMP traffic from IPsec by adding a filter with the following properties.

    Filter property Value
    FWPM_CONDITION_IP_LOCAL_ADDRESS_TYPEfiltering condition NlatUnicast
    FWPM_CONDITION_IP_PROTOCOL filtering condition IPPROTO_ICMP{V6}These constants are defined in winsock2.h.
    action.type FWP_ACTION_PERMIT
    weight FWPM_WEIGHT_RANGE_IKE_EXEMPTIONS

At FWPM_LAYER_OUTBOUND_TRANSPORT_V{4|6} setup outbound per-packet filtering rules

  1. Add a filter with the following properties.

    Filter property Value
    FWPM_CONDITION_IP_LOCAL_ADDRESS_TYPE filtering condition NlatUnicast
    action.type FWP_ACTION_CALLOUT_TERMINATING
    action.calloutKey FWPM_CALLOUT_IPSEC_OUTBOUND_TRANSPORT_V{4|6}
  2. Exempt ICMP traffic from IPsec by adding a filter with the following properties.

    Filter property Value
    FWPM_CONDITION_IP_LOCAL_ADDRESS_TYPE filtering condition NlatUnicast
    FWPM_CONDITION_IP_PROTOCOL filtering condition IPPROTO_ICMP{V6}These constants are defined in winsock2.h.
    action.type FWP_ACTION_PERMIT
    weight FWPM_WEIGHT_RANGE_IKE_EXEMPTIONS

Related topics

Sample code: Using Transport Mode

Filtering Layer Identifiers

Provider Context Types

Filtering Conditions

FWPM_ACTION0

Built-in Callout Identifiers

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。