To NAT you must change the source or destination IP in a direction and do the opposite in the other direction. Remember to recalculate the checksum of the packets. You’ll have no problems using winpkfilter driver to NAT, I’ve done it without problems.
i can receive the packet from Client and modify packet ,recauclate checksum(it’s ok),but i cant forward to other NIC(WAN)
so i got trouble to implement NAT
how to bind the different nic and translate packet to other NIC
and i confuse the how to used the “SendPacketToAdapter” and
or have else procedure i havt to notice. please help me , thanks
One of the approaches (the easiest from my point of view) is filtering Server(WAN) interface substituting the original IP (if it is from LAN) in the outgoing packet with Server WAN card IP (port substitution also should be done in order to perform backward mapping). For incoming packets on the Server (WAN) interface you should match against NAT table and perform the reversed operation. Please note that packet forwarding should be enabled on the Server. You don’t need to route packets youself, TCP/IP will do it for you.