How to Configure BGP Weight Attribute

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

1 Like

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

1 Like

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

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

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

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

1 Like

@lagapidis @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

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

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

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

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 How%20to%20configure%20BGP%20Weight%20Attributebut 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

1 Like

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

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

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

Hi arindom.nag
thanks alot your recommend

Welcome Bahria :smile:

welcome arindom.nag :smile:

Hi Rene,

Probably a bit of a retarded/basic question., but please could you explain why you did the following below - regarding BGP Weight PA.:

You used the following:

R1(config)#route-map SETWEIGHT permit 10
R1(config-route-map)#match ip address 1
R1(config-route-map)#set weight 400
R1(config-route-map)#exit
R1(config)#route-map SETWEIGHT permit 20
R1(config-route-map)#set weight 0
R1(config-route-map)#exit
R1(config)#access-list 1 permit 22.22.22.0 0.0.0.255

R1(config-router)#neighbor 192.168.13.3 route-map SETWEIGHT in

Why did you use two permit statements and why was it applied to the ā€œinā€ direction?

Many Thanks

Hello Champion

This route map has two steps. Both steps have permit clauses because if a match occurs, we want to be able to modify the weight attribute of that match and send it on its way. If there were deny clauses and a match occurred, even if the weight was changed, the particular path would be blocked. So by having permit statements, we are allowing that specific path AND we are thus able to change its weight attribute.

Secondly, there are two permit statements because we want to classify traffic from a particular subnet. Specifically the 22.22.22.0/24 subnet. The first permit statement attempts to match this IP address. If it matches, then the weight of that path is set to 400. The second permit statement is for all other traffic that does not match this ACL. Those destinations are classified with a weight of 0. Thus we are giving preferential treatment, or more weight, to routes matching the 22.22.22.0/24 destination.

Finally, the in/out direction of the application of route maps for BGP neighbors is a bit confusing. The rule of thumb is this: Applying inbound route-map influences outbound traffic and applying outbound route-map influences inbound traffic.

I hope this has been helpful!

Laz

Hey Lagapides,

Thank you so much. This cleared up a lot for me. Especially the ā€œinā€ and ā€œoutā€ issue.

Regards

1 Like