BGP - Prefered Route

Hi,

Belong my Vyos Lab :

All eBGP execpt Vy6 -> Vy-7 iBGP

image

From Vy4 I can reach all network (router) in this configuration :

SHOW IP ROUTE (Vy4)

image

Encore from Vy4 when i type traceroute on last Vy (Vy8) :

image

So Vy-5 -----> Vy-7 -----> Vy-6 -----> Vy-8

My question is, how i can select route more direct to reach Vy-8

I presume metric configuration,…

image

Thanks in advance.

Vy-4 config

set interfaces ethernet eth0 address ‘99.99.99.4/24’
set interfaces ethernet eth0 hw-id ‘0c:1c:0a:fc:7e:00’
set interfaces ethernet eth1 address ‘200.200.200.4/24’
set interfaces ethernet eth1 hw-id ‘0c:1c:0a:fc:7e:01’
set interfaces ethernet eth2 hw-id ‘0c:1c:0a:fc:7e:02’
set interfaces ethernet eth3 hw-id ‘0c:1c:0a:fc:7e:03’
set interfaces loopback lo address ‘10.4.4.4/32’
set interfaces vti vti10 address ‘11.0.0.2/31’
set policy prefix-list AS65566-IN rule 10 action ‘permit’
set policy prefix-list AS65566-IN rule 10 prefix ‘99.99.99.0/24’
set policy prefix-list AS65566-IN rule 11 action ‘permit’
set policy prefix-list AS65566-IN rule 11 prefix ‘88.88.88.0/24’
set policy prefix-list AS65566-IN rule 12 action ‘permit’
set policy prefix-list AS65566-IN rule 12 prefix ‘10.0.0.0/24’
set policy prefix-list AS65566-IN rule 13 action ‘permit’
set policy prefix-list AS65566-IN rule 13 prefix ‘77.77.77.0/24’
set policy prefix-list AS65566-IN rule 14 action ‘permit’
set policy prefix-list AS65566-IN rule 14 prefix ‘200.200.200.0/24’
set policy prefix-list AS65566-OUT rule 10 action ‘permit’
set policy prefix-list AS65566-OUT rule 10 prefix ‘99.99.99.0/24’
set policy prefix-list AS65566-OUT rule 11 action ‘permit’
set policy prefix-list AS65566-OUT rule 11 prefix ‘88.88.88.0/24’
set policy prefix-list AS65566-OUT rule 12 action ‘permit’
set policy prefix-list AS65566-OUT rule 12 prefix ‘10.0.0.0/24’
set policy prefix-list AS65566-OUT rule 13 action ‘permit’
set policy prefix-list AS65566-OUT rule 13 prefix ‘77.77.77.0/24’
set policy prefix-list AS65566-OUT rule 14 action ‘permit’
set policy prefix-list AS65566-OUT rule 14 prefix ‘200.200.200.0/24’
set policy prefix-list AS65566-OUT rule 15 action ‘permit’
set policy prefix-list AS65566-OUT rule 15 prefix ‘100.100.100.0/24’
set policy prefix-list AS65566-OUT rule 16 action ‘permit’
set policy prefix-list AS65566-OUT rule 16 prefix ‘101.101.101.0/24’
set policy prefix-list AS65566-OUT rule 17 action ‘permit’
set policy prefix-list AS65566-OUT rule 17 prefix ‘102.102.102.0/24’
set policy prefix-list AS65566-OUT rule 18 action ‘permit’
set policy prefix-list AS65566-OUT rule 18 prefix ‘103.103.103.0/24’
set policy prefix-list AS65566-OUT rule 19 action ‘permit’
set policy prefix-list AS65566-OUT rule 19 prefix ‘104.104.104.0/24’
set policy route-map AS65566-IN rule 10 action ‘permit’
set policy route-map AS65566-IN rule 10 match ip address prefix-list ‘AS65566-IN’
set policy route-map AS65566-OUT rule 10 action ‘permit’
set policy route-map AS65566-OUT rule 10 match ip address prefix-list ‘AS65566-OUT’
set protocols bgp 65566 address-family ipv4-unicast network 10.4.4.4/32
c ‘2’
set protocols bgp 65566 neighbor 99.99.99.3 address-family ipv4-unicast route-map export ‘AS65566-OUT’
set protocols bgp 65566 neighbor 99.99.99.3 address-family ipv4-unicast route-map import ‘AS65566-IN’
set protocols bgp 65566 neighbor 99.99.99.3 ebgp-multihop ‘2’
set protocols bgp 65566 neighbor 99.99.99.3 remote-as ‘65535’
set protocols bgp 65566 neighbor 99.99.99.3 update-source ‘99.99.99.4’
set protocols bgp 65566 neighbor 200.200.200.5 ebgp-multihop ‘2’
set protocols bgp 65566 neighbor 200.200.200.5 remote-as ‘44500’
set protocols bgp 65566 neighbor 200.200.200.5 update-source ‘200.200.200.4’
set protocols bgp 65566 parameters router-id ‘10.4.4.4’
set protocols static route 10.4.4.4/32 blackhole distance ‘254’

Hi,

your Router Vy-4 only have its next hop. Vy-5 decides which next nexthop will be used. On Vy-5 you can manipulate the route selection in a import route-map, for example with change the weight.
https://docs.vyos.io/en/latest/routing/bgp.html#route-selection

1 Like

Hello Rob,

Thanks for your reply.

I changed the redistribute on Vy-7

set protocols bgp 44501 address-family ipv4-unicast redistribute connected metric ‘10’

On Vy-4

image

Vy-5

image

Rob,

My actual config :

(Vy-5)

image

image

Vy-4

image

image

:frowning: what is wrong ?

Hi,

the value in the brackets are a the tag. You can check the weight or other bgp related infos with:

show ip bgp

you set the weight to the prefix, but both router 100.100.100.6 and 102.102.102.7 propagate this prefix.
One option is create a route-map per neighbor or you match with e.g. the interface in the route-map

1 Like

Vy-5

image

Vy-6

image

Vy-7

image

TRACEROUTE Vy-4

image

image

So seems OK, ben when i disconnect link Vy-6 with Vy-5 i can’t reach Vy-8 on LAN 103.xxx

image

I need to add a prefix list for LAN 103 to advertise Vy-7

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.