a key thing to remember is the rules are not checked for every packet.
We maintain a connection entry for each connection (TCP and UDP and ICMP - UDP and ICMP are simulated connections with timeouts etc).
This connection entry stores things like which next hop MAC and interface to use. And which bandwidth rule to use.
The settings in the connection entry are initialised when we first receive a packet that is not part of any known existing connection - a new connection.
So it's only the initial packet which is inspected for matching bandwidth rules.
This packet might be NATed out to somewhere, or intercepted up the stack. But changes to the addresses happen after the rule is looked up, so the rule must match the packet actually received by WinGate (not the altered packet) in order to apply.
So consider 2 cases.
1. A client makes a NAT connection to
www.wingate.com2. A client makes a proxy connection to
www.wingate.comin case 1, the SYN packet received by WinGate will contain the destination address 210.55.214.36
in case 2, the SYN packet received by WinGate will contain the destination address 192.168.0.1, and a subsequent connection made will contain destination address 210.55.214.36 (but this will be from the WinGate host).
So, if you had a rule which matched on dest IP 210.55.214.36, then if you had the "apply to traffic to/from local...." set, it would apply to the connection in both cases. If not set, then it would apply only to the connection in case 1.
Consider another then
1. A client 192.168.0.2 makes a NAT connection to
www.wingate.com2. A client 192.168.0.2 makes a proxy connection to
www.wingate.comin both cases, the SYN packet received by WinGate will contain the source address 192.168.0.2, and the destination addresses will be per the previous example.
If you have a rule which matches on source IP 192.168.0.2, then it will match the first connection, but only match the second connection if the option "apply to traffic to / from...' set.