Community discussions

MikroTik App
 
mauricioisp
Member Candidate
Member Candidate
Topic Author
Posts: 148
Joined: Wed Feb 06, 2013 2:48 am

BGP unable to force outgoing traffic

Fri May 15, 2015 8:26 am

Hi guys,
I'm trying to force our outgoing traffic to use one of our IP transit providers with higher priority (the one with gateway 192.168.yy.yy ), but I'm unable to do that and the router still select as active the other ISP (the one with gateway 186.148.xx.xx ):

[user@CCR X] > ip route print where dst-address in 198.38.124.0/24
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADb 198.38.124.0/24 186.148.xx.xx 20
1 Db 198.38.124.0/24 192.168.yy.yy 20

[mauro@CCR X] > tool traceroute 198.38.124.1
# ADDRESS LOSS SENT LAST AVG BEST WORST STD-DEV STATUS
1 186.148.xx.xx 0% 5 0.8ms 0.9 0.8 1.3 0.2
...
6 198.38.124.1 0% 4 125.1ms 125.1 124.9 125.2 0.1



Here are the filters I'm applying
This is the one I don't want to use as primary, as you can see I'm prepending it 5 times, set-bgp-local-pref to 1 and same thing with set-bgp-weight

47 chain=TIWS-Out prefix=190.zzz.zzz.zzz/24 invert-match=no action=accept set-bgp-weight=1 set-bgp-local-pref=1>
set-bgp-prepend=5 set-bgp-prepend-path=""

And the one I want to use I'm using a higher set-bgp-weight and a higher set-bgp-local-pref

18 chain=ISP2-Out prefix=190.zzz.zzz.zzz/24 invert-match=no action=accept set-bgp-weight=10
set-bgp-local-pref=100 set-bgp-prepend-path=""


I don't know what i'm doing wrong.

Please help! :)

Thanks,
 
mauricioisp
Member Candidate
Member Candidate
Topic Author
Posts: 148
Joined: Wed Feb 06, 2013 2:48 am

Re: BGP unable to force outgoing traffic

Fri May 15, 2015 11:39 pm

Any one?
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: BGP unable to force outgoing traffic

Fri May 15, 2015 11:42 pm

If you're only trying to affect your own egress path preference, then weight is more than enough to do the job - local pref doesn't even get checked if the weights aren't the same.

I suspect that the prefix isn't matching.
Is the target route actually in BGP as a /24?

e.g. Suppose the prefix you want is 192.168.32.0/24 but the route in BGP is 192.168.32.0/22 - then your match criteria isn't going to match because there is no /24 in BGP.

Perhaps there are longer prefixes than /24 and you're trying to include them all in a single /24 statement.....
This is doable - you must specify prefix-length = 24-32 in order to match subsets of your prefix.

Also, be sure the action is Accept - so that your prefix is being placed into the local BGP table. It would be ironic if the action is passthrough and the next rule in the filter chain is "Deny Everything Else" because you'd be setting the weight and then throwing it away.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: BGP unable to force outgoing traffic

Fri May 15, 2015 11:46 pm

I just noticed the name of your filters - they're both "ISPx_OUT"

weight, local_pref, etc - all of that is lost when speaking ebgp. If you're trying to affect your outbound traffic to those destinations, then those rules need to be in your IN filters.

You want to stamp the routes as "preferred" or "use only in case of emergency" as you RECEIVE them.

In bgp filters, out = a filter applied to information before it is advertised to the peer.
 
mauricioisp
Member Candidate
Member Candidate
Topic Author
Posts: 148
Joined: Wed Feb 06, 2013 2:48 am

Re: BGP unable to force outgoing traffic

Sat May 16, 2015 3:08 am

Hi ZeroByte,
Thank you for your response. Actually I would like to force all our outgoing traffic through ISP2, and use TIWS (aka ISP1) only as a backhaul. I applied the filter to all destinations, just put 198.38.124.0/24 as an example of what I see in the route table. The 190.zzz.zzz.zzz/24 is our IP block, so I use it in the prefix field, so in order to modify outgoing traffic should create a filter in the ISPx_IN chain? I thought that needs to be done in the ISPx_OUT

Sorry I'm not a BGP expert that's the reason cause I'm probably not understanding it very easily. So, I need to set-bgp-weight in the IN chains, is that correct?

Thanks
 
mauricioisp
Member Candidate
Member Candidate
Topic Author
Posts: 148
Joined: Wed Feb 06, 2013 2:48 am

Re: BGP unable to force outgoing traffic

Fri May 22, 2015 3:18 am

Hi ZeroByte,
Did you have any chance to check my last message?
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: BGP unable to force outgoing traffic

Sat May 23, 2015 4:14 am

Sorry I'm not a BGP expert that's the reason cause I'm probably not understanding it very easily. So, I need to set-bgp-weight in the IN chains, is that correct?
Yes, that's correct. When you receive a route from a neighbor, if you want to prefer it more than other routes, then increase the weight (higher number = higher weight). You can use all kinds of criteria to set the weight, but if you just want to prefer one provider over another for egress traffic, then simply increase the weight of every route learned, without any criteria at all.

Who is online

Users browsing this forum: No registered users and 50 guests