You could add that route-map to R2 and R4 so that R2 sets the tag and R3 doesn’t redistribute it back into OSPF because of the tag.
That works, but it also means that the OSPF domain won’t know about the 188.8.131.52/24 network. If you have another router (let’s say R5) in the OSPF domain that needs that route, then you have a problem.
Of course, it’s unlikely to see stuff like this on a production network but be very careful when reading the requirement(s) on an exam.
Here is an example where you should use tags:
- We have RIP and OSPF, R3 and R4 are redistribution routers.
- R1 advertises the 184.108.40.206/24 network with a hop count of 10. R3 redistributes it into OSPF.
- R4 redistributes 220.127.116.11/24 back into RIP with a hop count of 1.
- R2 now installs 18.104.22.168/24 with R4 as the next hop.
To prevent this from happening, you can add your route-map on R3 and R4 to prevent R4 from redistributing 22.214.171.124/24 back into RIP.
RIP is vulnerable to this issue, OSPF and EIGRP not. OSPF always prefers inter-area routes (O) over external routes (O E) and EIGRP has a higher AD for external routes.
Hope this helps!