I am implementing a solution with 4 routers connected to each other in iBGP and EBGP.
Specifically, I would like that:
Networks 18.104.22.168/24 and 22.214.171.124/24 behind router R2 arrive via eBGP on the LAN network of router R1 (10.10.10.0/24) as follows:
126.96.36.199/24 through R3
188.8.131.52/24 through R4
In case of failure of one of the two LTE routers, the network (184.108.40.206 or 220.127.116.11) must automatically pass through the router that remained active (R3 or R4)
I tried with the routing filter configuration on R2 to R1 by modifying the MED.
The incoming traffic works correctly and returns divided, I see that the 18.104.22.168/24 network from the R3 router while the 22.214.171.124/24 returns from the R4 router.
The problem is outgoing,
BGP route on router R2 automatically sets the default route to a single router (R3 or R2) and not to both (correct), but if I configure the mangles I can make both routes to the 10.10.10.0/24 destination (LAN of R1); a pass-through for R3 with source 126.96.36.199 and a pass-through for R4 with source 188.8.131.52.
Everything works perfectly, but when I disconnect one of the two routers (R3 or R4) one of the two networks of R2 no longer reaches the 10.10.10.0/24 network
I noticed that the problem is the prefixes configured to use the mangle and therefore consequently from the R3 and R4 routers only the single networks are allowed as they started from R2 with the mangle prerouting.
Can anyone help me, even with another method, to make sure that I have a multihomed BGP with load sharing and failover? where the traffic coming from one lan of R2 goes through R3 and the other network of R2 goes through R4?
PS: R3-R4 and R1 routers are in IBGP while router R2 to R3 and R4 communicate with EBGP