07-08-2021 07:23 PM
Hi Guys,
We have an identical configuration for BGP connection to 2 sites(but with different prefix advertisement) and BGP connection is up with both. We can receive neighbor routes for both. We have selective route advertisements with prefix-list as in config below.
However, our router does not advertise route with one of the site (neighbor 10.150.2.150) while it advertise to other site(neighbor 169.254.11.10)
Any idea about what could be wrong or to check ?
Thanks in advance.
=====================================
router bgp 64520
bgp log-neighbor-changes
network 10.10.5.0 mask 255.255.255.0
network 192.168.1.0
network 192.168.100.0
network 192.168.116.16 mask 255.255.255.255
neighbor 10.150.2.150 remote-as 1
neighbor 10.150.2.150 local-as 64525
neighbor 10.150.2.150 description "bgp to Hub"
neighbor 10.150.2.150 soft-reconfiguration inbound
neighbor 10.150.2.150 route-map ToHub out
neighbor 169.254.11.10 remote-as 2
neighbor 169.254.11.10 local-as 64521
neighbor 169.254.11.10 description "bgp to Gcl"
neighbor 169.254.11.10 soft-reconfiguration inbound
neighbor 169.254.11.10 route-map ToGcl out
ip prefix-list ToGcl seq 10 permit 10.10.5.0/24
ip prefix-list ToGcl seq 20 permit 192.168.1.0/24
ip prefix-list ToGcl seq 30 permit 192.168.100.0/24 => These 3 routes get advertised
!
ip prefix-list ToHub seq 10 permit 192.168.116.16/32 => This is not getting advertised
route-map ToGcl permit 10
match ip address prefix-list ToGcl
!
route-map ToHub permit 10
match ip address prefix-list ToHub
(2)
UTA-R#sh ip bgp neighbors 10.150.2.150 advertised-routes
Total number of prefixes 0
UTA-R#sh ip bgp neighbors 169.254.11.10 advertised-routes
BGP table version is 40, local router ID is xxxx.6
Network Next Hop Metric LocPrf Weight Path
*> 10.10.5.0/24 0.0.0.0 0 32768 i
*> 192.168.1.0 10.10.5.254 0 32768 i
*> 192.168.100.0 10.10.5.254 0 32768 i
Total number of prefixes 3
(3)
UTA-R#sh ip route
Gateway of last resort is xxxx.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via xxxx.1
10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks
C 10.10.5.0/24 is directly connected, GigabitEthernet0/1
L 10.10.5.1/32 is directly connected, GigabitEthernet0/1
S 192.168.1.0/24 [1/0] via 10.10.5.254
S 192.168.2.0/24 [1/0] via 10.10.5.254
S 192.168.4.0/24 [1/0] via 10.10.5.254
S 192.168.100.0/24 [1/0] via 10.10.5.254
S 192.168.116.0/24 [1/0] via 10.10.5.254
07-09-2021 02:59 AM - edited 07-09-2021 03:05 AM
The BGP network statement needs a matching route in the IP routing table and you don't have a route for 192.168.116.16 255.255.255.255 in your routing table.
Try adding this static route -
ip route 192.168.116.16 255.255.255.255 10.10.5.254
Jon
07-09-2021 03:15 AM - edited 07-09-2021 03:22 AM
Thank you Jon,
We had a route for the network defined for the full network but seems we need specific /32 route as your comment.
S 192.168.116.0/24 [1/0] via 10.10.5.254
After adding that route it is getting advertised now.
"ip route 192.168.116.16 255.255.255.255 10.10.5.254"
Another prefix which is not advertised is L (directly connected)
L 192.168.100.100/32 is directly connected, GigabitEthernet0/0
How could we advertise or add routes for directly connected network in BGP? there is a reference to "redistribute connected" command but how to distribute only specific directly connected route to only one remote AS.?
in our case advertise directly connected 192.168.100.100/32 to only neighbour 10.150.2.150
07-09-2021 03:28 AM
But you are advertising out 192.168.100.0/24 so that would cover the directly connected route wouldn't it ?
Basically BGP requires an exact match in the routing table as you have seen ie. the prefix and the subnet mask must match.
For directly connected you could always use "redistribute connected" but that would still only advertise 192.168.100.0/24 and not the host entry.
Jon
07-09-2021 05:35 AM - edited 07-09-2021 05:37 AM
Another prefix which is not advertised is L (directly connected)
C 192.168.100.0/24 is directly connected, GigabitEthernet0/0
L 192.168.100.6/32 is directly connected, GigabitEthernet0/0
L 192.168.100.100/32 is directly connected, GigabitEthernet0/0
How could we selectively advertise or add routes for directly connected network in BGP? there is a reference to "redistribute connected" command but how to distribute only specific directly connected route(/32) to only one neighbour and not all neighbours.?
in our case advertise directly connected 192.168.100.100/32 to only neighbour 10.150.2.150
07-09-2021 05:54 AM
You can use a route map with your redistribute statement but I don't think it will do what you want.
If you redistribute connected it will advertise 192.168.100.0/24 not the host entry.
Jon
07-09-2021 07:32 AM
Hello Jon,
>> If you redistribute connected it will advertise 192.168.100.0/24 not the host entry.
I totally agree with you.
These L routes are just place holders for IP addresses of interfaces.
Hope to help
Giuseppe
07-09-2021 07:25 AM
Hello @Sandip Barot ,
as @Jon Marshall has tried to explain you the L /32 routes are just placeholders that tell you what IP address the interface of the local router has on the connected subnet.
However, the prefix is always represented by the C connected route.
Just to be clear in the past for many years L routes /32 did not exist in IP routing table.
To see your own IP addresses you had to use
show ip int brief
Now, with the addtion of L routes you see this info in the IP routing table but it is not representing a prefix just an interface.
So simply ignore L routes you don't need to advertise them ( not only in BGP but in any routing protocol )
Hope to help
Giuseppe
07-09-2021 07:30 PM
Thanks for your responses @Jon Marshall @Giuseppe Larosa
So, it seems it is not possible to advertise single host /32( from directly connected network) to one neighbor only.
07-10-2021 12:18 AM
Hello @Sandip Barot ,
>> So, it seems it is not possible to advertise single host /32( from directly connected network) to one neighbor only.
You can advertise the connected prefix to a single neighbor and this is enough for every practical need in real world.
I don't see any real use case where someone would need / like to advertise the interface address the so called L "route".
A router works on prefixes interconnecting different IP subnets and advertises subnets / prefixes in routing protocols like BGP if configured for doing it.
Hope to help
Giuseppe
07-10-2021 09:49 PM - edited 07-10-2021 10:00 PM
Many thanks for your inputs and I really appreciate your help, Giuseppe and Jon. I still need some more clarification to understand this a bit further.
So, for the below directly connected route we can only advertise full prefix [ie presented with "C"-192.168.100.0/24] and not a single IP from the subnet ie "L 192.168.100.100/32". or some other IP from the subnet for example 192.168.100.111 ?
C 192.168.100.0/24 is directly connected, GigabitEthernet0/0
L 192.168.100.6/32 is directly connected, GigabitEthernet0/0
L 192.168.100.100/32 is directly connected, GigabitEthernet0/0
We have a requirement where we wanted to advertise only single public IP to the neighbor from the directly connected subnet, so wanted to check.
With static routes "S", we can do a single IP but is it limitation as above for directly connected route where we can`t do a few IP or single IP from the prefix ? ie as below- works and advertsied fine.
192.168.116.0/24 is variably subnetted, 2 subnets, 2 masks
S 192.168.116.0/24 [1/0] via 10.10.5.254
S 192.168.116.16/32 [1/0] via 10.10.5.254
07-11-2021 02:31 AM
I don't think you are going to be able to advertise the IP assigned to the interface on the router but for other IPs out of that subnet you could add a static route with an the exit interface as the next hop eg.
ip route 192.168.100.111 255.255.255.255 gi0/0
and then you can advertise in BGP.
Why you would want to do this is another question though.
Jon
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide