How to use WFP to forward packaget from specific process to specific network adapter?

mao hei 0 Reputation points
2025-04-14T09:13:21.7266667+00:00

Here is the senario. i got 2 network adapters in my computer.I want to configure one to be ‌exclusively used by a specific program‌ while ‌hiding it from the user‌ and ‌excluding it from system routing. 

i found FWPM_LAYER_IPFORWARD_V4 layer and API FwpsInjectForwardAsync0. Can i use FwpsInjectForwardAsync0 to inject to specific NIC in FWPM_LAYER_IPFORWARD_V4 layer.

I saw in doc " The FwpsInjectForwardAsync0 function injects packet data into the forwarding data path." What's the meaning of forwarding data path? does it mean ip route forward ?

Windows Network
Windows Network
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Network: A group of devices that communicate either wirelessly or via a physical connection.
862 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Joseph Tran 0 Reputation points
    2025-05-01T17:22:42.67+00:00
    1. Packet Modification Sample with WFP This driver sample demonstrates how to use WFP to modify and redirect packets (especially UDP and ICMP) through clone-modify-reinject mechanisms. 🔗 Windows Filtering Platform Packet Modification Sample
    2. Using Bind or Connect Redirection This guide explains how to use redirection features in WFP at the ALE_BIND_REDIRECT and ALE_CONNECT_REDIRECT layers, allowing modification of address and port during connections. 🔗 Using Bind or Connect Redirection
    3. WFP Traffic Redirection Driver on GitHub This open-source project provides a driver using WFP to redirect network traffic based on IP address, port, and MAC address, with flexible configuration via registry. 🔗 BOT-Man-JL/WFP-Traffic-Redirection-Driver
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.