In my lab I have two routers which are connected to different ISPs.
They're not directly connected via a wire, but they're connected via a tunnel.
Through that tunnel I used to create an iBGP peer and they exchange routes.
Now, router A sends a better route to router B which now installs it into its routing table.
Now Router B is "able" to reach everything through the tunnel via Router A.
The above scenario describes my problem and I thought the solution was to check incoming routes which come from the neighbor router in the same AS and add a higher distance so that existed routes won't change.
Is that even a good solution? If yes, how am I able to do that?
Here's my filter configuration so far, but, unfortunately, it doesn't work properly:
import filter {
if bgp_path ~ [= AS_NUMBER =] then
{
bgp_path.prepend(AS_NUMBER);
bgp_path.prepend(AS_NUMBER);
bgp_path.prepend(AS_NUMBER);
bgp_path.prepend(AS_NUMBER);
bgp_path.prepend(AS_NUMBER);
bgp_path.prepend(AS_NUMBER);
bgp_path.prepend(AS_NUMBER);
accept;
}
reject;
};
But the problem seems to be more complicated:
I need to adjust a preference on both iBGP routers.
E.g. router A has a higher preference than router B, router B will send send everything through router A.
Either my settings are wrong, or performing an iBGP peer through a tunnel is more than wrong.