as observed in postrouting log when using mark connection, mark packet and mark routing to route the traffic through PPPoE interface with static ip address there is NAT translation active and therefore the src port is wrong in output chain?
- but if main routing table is changed in a way that default route is changed in a way that it exits the PPoE interface - NAT is not applied.
Sample from the log:
I observe NAT-ing on postrouting log.
Code: Select all
19:59:49 firewall,info MC ==> output: in:(unknown 0) out:ether3-WAN1, proto UDP, 172.16.16.2:5555->149.7.81.125:5555, [b]NAT (172.16.16.2:5555->A.B.C.88:53386)[/b]->149.7.81.125:5555, len 120
19:59:49 firewall,info MP ====>> output: in:(unknown 0) out:ether3-WAN1, proto UDP, 172.16.16.2:5555->149.7.81.125:5555, [b]NAT (172.16.16.2:5555->A.B.C.88:53386)[/b]->149.7.81.125:5555, len 120
19:59:49 firewall,info MR ====>>> output: in:(unknown 0) out:ether3-WAN1, proto UDP, 172.16.16.2:5555->149.7.81.125:5555, [b]NAT (172.16.16.2:5555->A.B.C.88:53386)[/b]->149.7.81.125:5555, len 120
19:59:49 firewall,info RESULT =====>>>>> postrouting: in:wg0 out:PPPoE, proto UDP, 172.16.16.2:5555->149.7.81.125:5555, [b]NAT (172.16.16.2:5555->A.B.C.88:53386)[/b]->149.7.81.125:5555, len 120
How to avoid this?
---------------------------
If i redirect the traffic out via PPPoE via default route in main table this works fine:
(The default route in "main" table is on PPPoE interface, No NAT, src port is 5555 (as expected by the wg client).
Code: Select all
20:03:24 firewall,info MC ==> output: in:(unknown 0) out:PPPoE, proto UDP, A.B.C.88:5555->149.7.81.125:5555, len 60
20:03:24 firewall,info MP ====>> output: in:(unknown 0) out:PPPoE, proto UDP, A.B.C.88:5555->149.7.81.125:5555, len 60
20:03:24 firewall,info MR ====>>> output: in:(unknown 0) out:PPPoE, proto UDP, A.B.C.88:5555->149.7.81.125:5555, len 60
20:03:24 firewall,info =====>>>>> postrouting: in:wg0 out:PPPoE, proto UDP, A.B.C.88:5555->149.7.81.125:5555, len 60
So how do i get that the output IP is A.B.C.88 and src port is 5555 without having to change the default route (defacto; stop seeing NAT in the logs)?
What could i do to try to use mangle facility (MC->MP->MR) to route the packets out through PPPoE but with PPPoE (static) IP address as source IP and src port 5555?
In other words is there something i could do to have the (lower, working) output but using anything else except changing the default route (or adding static routes)?