- Have a routing table for each ISP
- Add a default route in said table for the ISP in question
- Mark incoming connections for each ISP with a respective connection mark (mangle prerouting)
- Mark outgoing connections using PCC with a respective connection mark (mangle prerouting & mangle output)
- Mark routing for the respective connection marks to their respective routing tables
- Transform traffic between external and internal networks
This latter step is for traffic to flow properly and making the outside transparent to the inside network. This means that in IPv4 we have a masquerade rule in the srcnat chain handling the translation of outgoing traffic and, as needed, dst-nat rules in the dstnat chain for port-forwarding (/32 publics to many internal addresses). For IPv6 this means using prefix translation to convert an ULA to the respective GUA for the given ISP and viceversa (/48 publics to /48 internal).
Where this whole thing seems to go wrong for IPv6 is on this very last part. The original idea was to use the mangle dnpt and snpt rules but these require the connections to be untracked and are as such not an option as this would prevent the use of the firewall. That means the next option is using netmap rules in the dstnat (prerouting equivalent for the mangle mark rules) and output chains in the NAT table.
Sadly, this latter option also does not seem to function properly and at this point I'm not sure if I'm just fucking something up or this is just broken in RouterOS atm (I'm on v7.3.1). The rules are currently as follows:
Code: Select all
/ipv6 firewall nat
# NPT from ULA to GUA (isp1)
add action=netmap chain=dstnat connection-mark=isp1 src-address=priv:ater:ange::/48 to-address=publ:icra:nge1::/48
add action=netmap chain=output connection-mark=isp1 src-address=priv:ater:ange::/48 to-address=publ:icra:nge1::/48
# NPT from GUA (isp1) to ULA
add action=netmap chain=dstnat dst-address=publ:icra:nge1::/48 to-address=priv:ater:ange::/48
add action=netmap chain=output dst-address=publ:icra:nge1::/48 to-address=priv:ater:ange::/48
# NPT from ULA to GUA (isp2)
add action=netmap chain=dstnat connection-mark=isp2 src-address=priv:ater:ange::/48 to-address=publ:icra:nge2::/48
add action=netmap chain=output connection-mark=isp2 src-address=priv:ater:ange::/48 to-address=publ:icra:nge2::/48
# NPT from GUA (isp2) to ULA
add action=netmap chain=dstnat dst-address=publ:icra:nge2::/48 to-address=priv:ater:ange::/48
add action=netmap chain=output dst-address=publ:icra:nge2::/48 to-address=priv:ater:ange::/48
# NPT from ULA to GUA (isp3)
add action=netmap chain=dstnat connection-mark=isp3 src-address=priv:ater:ange::/48 to-address=publ:icra:nge3::/48
add action=netmap chain=output connection-mark=isp3 src-address=priv:ater:ange::/48 to-address=publ:icra:nge3::/48
# NPT from GUA (isp3) to ULA
add action=netmap chain=dstnat dst-address=publ:icra:nge3::/48 to-address=priv:ater:ange::/48
add action=netmap chain=output dst-address=publ:icra:nge3::/48 to-address=priv:ater:ange::/48
I'd be very happy to hear any suggestions on what is going on here and how this same thing (PCC Load Balancing) can be achieved with IPv6 rules in RouterOS.