You can configure split horizon and poison reverse to prevent routing loops.
The principle of split horizon is that a route learned by RIP on an interface is not sent to neighbors from the interface. This reduces bandwidth consumption and avoids route loops.
The principle of poison reverse is that RIP sets the cost of the route learned from an interface of a neighbor to 16 (to specify the route as unreachable) and then sends the route from the interface back to the neighbor. In this way, RIP can delete useless routes from the routing table of the neighbor and also avoid route loops.
If both split horizon and poison reverse are configured, only poison reverse takes effect.
system-view
interface interface-type interface-number
Enable split horizon.
rip split-horizon
Enable poison reverse.
rip poison-reverse