Mon Nov 07, 2022 11:30 am
OK. So for 7.x, as @Sob has stated, you can use dst-nat for outgoing traffic of the router itself; for 6.x, you need to set up an IPIP tunnel between two own addresses of the client router, route the own traffic of the client router towards the CHR through one end of that IPIP tunnel, use a dst-nat rule to change the port as the connection emerges from the other end of that IPIP tunnel, and route it via the WAN. The src-nat rule changing the source port may be applied at any stage (first or second).
At the server side, you need to dst-nat the port back to 1701 as you cannot change on which port the L2TP server listens.
But if you use ROS 7, you can as well use Wireguard where you can configure the ports freely at both peers (there are no static roles of client (initiator) and server (responder)).
If you want to stay with ROS 6, you can use IKEv2 where you can also specify the destination port at the initiator side; src-nat rule at initiator and dst-nat rule at responder are still necessary. This is not possible with IKE(v1) because the port you specify is used only during the initial phase of session setup, and then it switches over to port 4500 if NAT is detected and there is no way except dst-nat to change the 4500 to another port.
Even if you use IKEv2 or Wireguard, you can still choose to only use them to encrypt the L2TP transport packets. The advantage of L2TP is that you can use MLPPP to avoid fragmentation at IP level - it silently splits large payload packets into multiple transport ones. This is useful to avoid problems related to broken PMTUD, but the problem of double packet rate remains the same like with the normal fragmentation at IP layer.