I want to do bonding with wireguard+eoip and several pppoe connections (each pppoe connection is on a unique ADSL line)
I am using routeros 7.1rc5
I use mangle rules to match the wireguard interface’s endpoint port and mark routing so each wg interface should route via a unique pppoe connection
However I’m facing a problem, namely all the wireguard connections are trying to use the same src-address (from whichever pppoe interface is the default route on main table), so it seems impossible to route each wireguard tunnel over a unique pppoe connection
How can I change the source address for each wg connection (ideally based on the endpoint port)?
It seems the only solution is to have a second mikrotik router and then do mangling on the forwarded packets. Surely this shouldn’t be necessary??
No, there’s a routing table created for each pppoe interface, each with a default route for that pppoe interface only. The problem is even if I mangle the wireguard ports and mark routing to the respective routing tables, the return packet replies never arrive from the remote host (the server) because all outgoing traffic (on the client) comes from the same src-address and routeros is using the src-address associated with the default route from the main rotating table
If the remote host had several public IP addresses then I could route each public IP address to a different PPPoE interface. It only has one though, so the best I can do is mangle the endpoint ports (src or destination) however this doesn’t change the src-address problem and so replies never get routed back
As you can see the router tried to establish the connections with src-address=192.168.0.2
It seems the solution was simply to add src-nat with relevant ports and to-address to the IP address of the respective pppoe interface.
The src-nat rules on their own don’t work unless output packets are marked and routed. So it’s a combination of all 3 rules that gets things going
So far so good, I will complete the setup and test to see if everything works as expected
That’s a great guide for load balancing in general, but actually no it doesn’t go into the specific issue I had here, which is namely to do with ensuring that all the wireguard interfaces use separate source addresses when establishing their links even if they all have the same endpoint IP (but not port obviously). So even though yes I’m implementing a load balancing solution as described in that document, the root problem here actually had nothing to do with the load balancing side of things, lol xD anyways it’s sorted now and I’m happy as hell. The power of MikroTik proves it’s worth for me yet again "thumbs up*