How to Configure BGP Weight Attribute


(Andrew P) #38

Sean,
Technically, you can absolutely reference the same ACL in multiple route-maps. Personally, I don’t do this, but only for easy of management. For example, if I were doing redistribution, I would have a route-map for that, named something like RM_REDIST that would reference an ACL dedicated for that purpose, named something like ACL_REDIST. This way, it is easy to figure out what components go together.

Again, there is no technical prohibition from doing what you are saying, though.


(Networklessons Admin) split this topic #39

19 posts were merged into an existing topic: How to Configure BGP Weight Attribute


(Lee M) #40

Hi Rene, Just a quick question, In Bgp Weight attribute lab you said that R1 will reach 2.2.2.0 /24 network through R2 because of the router ID attribute, If it was the router id than surely R1 would have sent traffic to 2.2.2.0/24 via R3 as R1 Router id is 192.168.13.1, … Please advise,


(Lazaros Agapides) #41

Hello Lee

If the weight attribute is not configured, then the router ID attribute is used to determine which path will be chosen. The Router ID attribute is the highest IP address on an active interface of the router with loopback addresses taking preference. So the router IDs of this network are:

R1: 192.168.13.1
R2: 192.168.12.2
R3: 192.168.13.3

Now BGP will always prefer the route that comes from the BGP router with the lowest router ID. Between R2 and R3, R2 has the lowest router ID, thus traffic will be sent via the R2 router.

I hope this has been helpful!

Laz


(Lee M) #42

Thanks Laz, But on the diagram we have loopbacks on both R2 and R3 of 2.2.2.0/24 so as per the Router Id election process surely the router id of both R2 and R3 should be 2.2.2.2 ?

Thanks


(Lazaros Agapides) #43

Hello Lee

Looking a little deeper into the issue, looking at the router configurations, the router IDs of both R2 and R3 are indeed the same as both Lo interfaces are set to 2.2.2.2. So according to BGP route selection process, if the router IDs are the same, then the router will prefer the route with the lowest neighbour IP address. So between R2 and R3, the lowest neighbour IP address is indeed 192.168.12.2, so R2 will be chosen as the path.

So the following statement in the lesson has to be revised:

image

…because the Router ID is actually that of the loopback interface, but since those are the same, the neighbour IP address is used. The result is the same, but the lesson should clarify this. I will let @ReneMolenaar know about it…

Thanks for your help!

Laz


(Lee M) #44

Thanks Laz for clarifying that for me and the prompt response.


(sims) #45

HI,
why you are gave the same loop back adress on both router
thanks


(Lazaros Agapides) #46

Hello sims

Yes it seems that @ReneMolenaar has used the same IP addresses on the Loopback 0 interfaces of both R2 and R3. Now both of these are in the same subnet, but they should actually have different IP addresses, such as 2.2.2.1 and 2.2.2.2. The same is the case for Loopback 1 on both interfaces. I will let Rene know to adjust this on the lessons…

Thanks!

Laz


(RAWAZ K) #47

please just let me know does weight attribute use for outbound traffic ( outgoing) traffic and AS-Path prepend used for inbound (incoming) traffic ? is that true , your feedback is appreciated.

Best Regards


(Rene Molenaar) #48

Hi Rawaz,

That is correct. The weight attribute defines the outgoing path but only for the local router. If you want to influence this for the entire AS, you can use the local preference attribute.

AS path prepending (or MED) can be used to influence inbound routing.

Rene


(Rene Molenaar) #49

@lagapides @sims

I used the same IP address on those loopbacks on purpose so that R2/R3 advertise the exact same thing in BGP. Otherwise, I could have added a fourth router in between R2/R3 with some loopbacks that were advertised in BGP.

Rene


(Arindom N) #51

Hi Rene,
Based on your last comments

when i am trying to useing same ip address(2.2.2.2) in loop back0 of R2 & R3 I am getting below mention error & the BGP state is is idle:

R3#
*Jul 18 21:48:05.895: %BGP-3-NOTIFICATION: sent to neighbor 192.168.23.2 passive 2/3 (BGP identifier wrong) 4 bytes 02020202
*Jul 18 21:48:05.895: %BGP-4-MSGDUMP: unsupported or mal-formatted message received from 192.168.23.2:
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0039 0104 0002 00B4 0202 0202 1C02 0601
0400 0100 0102 0280 0002 0202 0002 0246 0002 0641 0400 0000 02
R3#
*Jul 18 21:48:10.927: %BGP-5-NBR_RESET: Neighbor 192.168.23.2 passive reset (BGP Notification sent)
*Jul 18 21:48:10.927: %BGP-5-ADJCHANGE: neighbor 192.168.23.2 passive Down BGP Notification sent
*Jul 18 21:48:10.963: %BGP-3-NOTIFICATION: received from neighbor 192.168.23.2 active 2/3 (BGP identifier wrong) 4 bytes 02020202
*Jul 18 21:48:10.963: %BGP-5-NBR_RESET: Neighbor 192.168.23.2 active reset (BGP Notification received)
*Jul 18 21:48:10.963: %BGP-5-ADJCHANGE: neighbor 192.168.23.2 active Down BGP Notification received
*Jul 18 21:48:10.963: %BGP_SESSION-5-ADJCHANGE: neighbor 192.168.23.2 IPv4 Unicast topology base removed from session BGP Notification received
*Jul 18 21:48:14.091: %BGP-3-NOTIFICATION: sent to neighbor 192.168.23.2 passive 2/3 (BGP identifier wrong) 4 bytes 02020202
*Jul 18 21:48:14.091: %BGP-4-MSGDUMP: unsupported or mal-formatted message received from 192.168.23.2:
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0039 0104 0002 00B4 0202 0202 1C02 0601
0400 0100 0102 0280 0002 0202 0002 0246 0002 0641 0400 0000 02
*Jul 18 21:48:17.111: %BGP-3-NOTIFICATION: received from neighbor 192.168.23.2 active 2/3 (BGP identifier wrong) 4 bytes 02020202
*Jul 18 21:48:17.115: %BGP-5-NBR_RESET: Neighbor 192.168.23.2 active reset (BGP Notification received)
*Jul 18 21:48:17.115: %BGP-5-ADJCHANGE: neighbor 192.168.23.2 active Down BGP Notification received
*Jul 18 21:48:17.115: %BGP_SESSION-5-ADJCHANGE: neighbor 192.168.23.2 IPv4 Unicast topology base removed from session BGP Notification received

R2#
session BGP Notification received
*Jul 18 21:54:06.535: %BGP-5-NBR_RESET: Neighbor 192.168.23.3 passive reset (BGP Notification sent)
*Jul 18 21:54:06.535: %BGP-5-ADJCHANGE: neighbor 192.168.23.3 passive Down BGP Notification sent
*Jul 18 21:54:14.687: %BGP-3-NOTIFICATION: sent to neighbor 192.168.23.3 passive 2/3 (BGP identifier wrong) 4 bytes 02020202
*Jul 18 21:54:14.687: %BGP-4-MSGDUMP: unsupported or mal-formatted message received from 192.168.23.3:
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0039 0104 0002 00B4 0202 0202 1C02 0601
0400 0100 0102 0280 0002 0202 0002 0246 0002 0641 0400 0000 02
*Jul 18 21:54:14.763: %BGP-3-NOTIFICATION: received from neighbor 192.168.23.3 active 2/3 (BGP identifier wrong) 4 bytes 02020202
*Jul 18 21:54:14.763: %BGP-5-NBR_RESET: Neighbor 192.168.23.3 active reset (BGP Notification received)
*Jul 18 21:54:14.763: %BGP-5-ADJCHANGE: neighbor 192.168.23.3 active Down BGP Notification received
*Jul 18 21:54:14.763: %BGP_SESSION-5-ADJCHANGE: neighbor 192.168.23.3 IPv4 Unicast topology base removed from session BGP Notification received
*Jul 18 21:54:14.763: %BGP-3-NOTIFICATION: received from neighbor 192.168.23.3 active 2/3 (BGP identifier wrong) 4 bytes 02020202

after change the loopback ip address of R3 the BGP state is getting up so i think its due to same IP address in loopback of both R2 & R3 Routre id getting same & the session is getting up am i right Rene ? plz find the below details.

R3#sh ip inter brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.23.3 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down down
FastEthernet1/0 192.168.13.3 YES manual up up
FastEthernet1/1 unassigned YES unset administratively down down
Loopback0 2.2.2.2 YES manual up up
R3#sh ip bgp summary
BGP router identifier 2.2.2.2, local AS number 2
BGP table version is 2, main routing table version 2
1 network entries using 144 bytes of memory
1 path entries using 80 bytes of memory
1/1 BGP path/bestpath attribute entries using 136 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 360 total bytes of memory
BGP activity 4/3 prefixes, 8/7 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.13.1 4 1 37 35 2 0 0 00:28:55 0
192.168.23.2 4 2 0 0 1 0 0 00:28:56 Idle
R3(config)#inter loopback 0
R3(config-if)#no ip add
R3(config-if)#no ip address
R3(config-if)#ip add
R3(config-if)#ip address 2.2.2.3 255.255.255.0
R3(config-if)#end
R3#clear ip bgp *

R3#sh ip bgp summary
BGP router identifier 2.2.2.3, local AS number 2
BGP table version is 1, main routing table version 1
1 network entries using 144 bytes of memory
1 path entries using 80 bytes of memory
2/0 BGP path/bestpath attribute entries using 272 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 496 total bytes of memory
BGP activity 5/4 prefixes, 10/9 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.13.1 4 1 6 2 1 0 0 00:00:03 0
192.168.23.2 4 2 5 2 1 0 0 00:00:00 1

And as per your 2nd example when using ip address 22.22.22.22 in both R2 & R3 as a loopback getting same error bcz 22.22.22.22 is the highest ip address of loop back so as based on router Id selection process its correct but the BGP session is not up between R2 & R3.

Am i right Rene?i think you should fix this :smiley: waiting for your valuable answer.
Thanks & Regards,
Arindom


(Rene Molenaar) #52

Hi Arindom,

Take a look at this message:

BGP identifier wrong

And this output:

R3#sh ip bgp summary
BGP router identifier 2.2.2.2, local AS number 2

The problem is that both routers probably have the same BGP router ID. Try setting the router ID manually and it should be OK. BGP uses the IP address of the loopback as the router ID so that’s where it goes wrong.

Rene


(Arindom N) #53

Hi Rene,
Thanks for replying me…yes after set the router id in R3 now everything is up and not getting identifier error:smiley:

R3#sh running-config | include bgp
router bgp 2
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes

R3#sh ip bgp summary
BGP router identifier 1.1.1.1, local AS number 2
BGP table version is 1, main routing table version 1
2 network entries using 288 bytes of memory
2 path entries using 160 bytes of memory
2/0 BGP path/bestpath attribute entries using 272 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 720 total bytes of memory
BGP activity 6/4 prefixes, 8/6 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.168.13.1    4            1       6       2        1    0    0 00:00:05        0
192.168.23.2    4            2       5       2        1    0    0 00:00:03        2


R3#sh ip inter brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        192.168.23.3    YES NVRAM  up                    up
FastEthernet0/1        unassigned      YES NVRAM  administratively down down
FastEthernet1/0        192.168.13.3    YES NVRAM  up                    up
FastEthernet1/1        unassigned      YES NVRAM  administratively down down
Loopback0              2.2.2.2         YES manual up                    up
Loopback1              22.22.22.22     YES NVRAM  up                    up


---------------------------------------------------------------------------------------------

R2#sh ip bgp summary
BGP router identifier 22.22.22.22, local AS number 2
BGP table version is 3, main routing table version 3
2 network entries using 288 bytes of memory
3 path entries using 240 bytes of memory
2/1 BGP path/bestpath attribute entries using 272 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 800 total bytes of memory
BGP activity 2/0 prefixes, 3/0 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.168.12.1    4            1       5       5        3    0    0 00:01:18        0
192.168.23.3    4            2       5       5        3    0    0 00:01:12        1


R2#sh ip inter brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        192.168.12.2    YES NVRAM  up                    up
FastEthernet0/1        unassigned      YES NVRAM  administratively down down
FastEthernet1/0        192.168.23.2    YES NVRAM  up                    up
FastEthernet1/1        unassigned      YES NVRAM  administratively down down
Loopback0              2.2.2.2         YES NVRAM  up                    up
Loopback1              22.22.22.22     YES NVRAM  up                    up


R2#sh running-config | include bgp
router bgp 2
 bgp log-neighbor-changes

Then conclusion is if we want to use same loop back address in both router then 1st we should set the BGP router id(Like ospf) for specific identification, should not go for normal Router ID election process am i right Rene?

Thanks & Regards,
Arindom


(Arindom N) #54

Hi Rene,
Thanks for replying me…yes after set the router id in R3 now everything is up and not getting identifier error:smiley:

R3#sh running-config | include bgp
router bgp 2
bgp router-id 1.1.1.1
bgp log-neighbor-changes

R3#sh ip bgp summary
BGP router identifier 1.1.1.1, local AS number 2
BGP table version is 1, main routing table version 1
2 network entries using 288 bytes of memory
2 path entries using 160 bytes of memory
2/0 BGP path/bestpath attribute entries using 272 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 720 total bytes of memory
BGP activity 6/4 prefixes, 8/6 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.13.1 4 1 6 2 1 0 0 00:00:05 0
192.168.23.2 4 2 5 2 1 0 0 00:00:03 2

R3#sh ip inter brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.23.3 YES NVRAM up up
FastEthernet0/1 unassigned YES NVRAM administratively down down
FastEthernet1/0 192.168.13.3 YES NVRAM up up
FastEthernet1/1 unassigned YES NVRAM administratively down down
Loopback0 2.2.2.2 YES manual up up
Loopback1 22.22.22.22 YES NVRAM up up

R2#sh ip bgp summary
BGP router identifier 22.22.22.22, local AS number 2
BGP table version is 3, main routing table version 3
2 network entries using 288 bytes of memory
3 path entries using 240 bytes of memory
2/1 BGP path/bestpath attribute entries using 272 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 800 total bytes of memory
BGP activity 2/0 prefixes, 3/0 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.12.1 4 1 5 5 3 0 0 00:01:18 0
192.168.23.3 4 2 5 5 3 0 0 00:01:12 1

R2#sh ip inter brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.12.2 YES NVRAM up up
FastEthernet0/1 unassigned YES NVRAM administratively down down
FastEthernet1/0 192.168.23.2 YES NVRAM up up
FastEthernet1/1 unassigned YES NVRAM administratively down down
Loopback0 2.2.2.2 YES NVRAM up up
Loopback1 22.22.22.22 YES NVRAM up up

R2#sh running-config | include bgp
router bgp 2
bgp log-neighbor-changes

Then conclusion is if we want to use same loop back address in both router then 1st we should set the BGP router id(Like ospf) for specific identification, should not go for normal Router ID election process am i right Rene?

and one thing Rene in your topology picture 'How to configure BGP Weight Attribute" between R2(FastEthernet1/0) & R3(FastEthernet0/0) you didn’t add any IP address in topology picture

but in lesson you add when you configured so if you don’t mind here i want to give you a suggestion please add then it will good for the topology picture.:smile:

Thanks & Regards,
Arindom


(bahri a) #55

Hi
i received notification msg but configuration is true

R2#show run | begin bgp
router bgp 2
 bgp log-neighbor-changes
 network 2.2.2.0 mask 255.255.255.0
 neighbor 192.168.12.1 remote-as 1
 neighbor 192.168.23.3 remote-as 2

router bgp 2
 bgp log-neighbor-changes
 neighbor 192.168.13.1 remote-as 1
 neighbor 192.168.23.2 remote-as 2
!


*Aug 20 16:57:54.777: %BGP-3-NOTIFICATION: received from neighbor 192.168.23.3 a^ctive 2/3 (BGP identifier wrong) 4

(bahri a) #56

thanks everybody i solved it
router-id conflict
took the same id
i shutdown interface than i changed router- id


(Arindom N) #57

Hi Bahiri,
Good job:+1:you solved this

If you read the above messages you can able to see i did same mistake then Rene rectify me:smile:

Thanks & Regards,
Arindom


(bahri a) #58

Hi arindom.nag
thanks alot your recommend