HI, thanks for the reply. I agree with your assessment to use static route to install more specific route in the routing table. The issue I seem to notice is that : the subnet is advertised as a connected route and all the servers ( 188.8.131.52 ) are on the same switch. Let’s say you use a static route how will the switch route traffic destined ( return traffic ) to this particular server ?
NOTE : I obviously can’t use a static Null0 route in this case.
In the route table it will have two routes :
184.108.40.206/27 as connected/direct
220.127.116.11 as static with a next-hop to particular interface ( any un-used interface ) .
Will connected route take precedence over static and the traffic destined to the server is switched to the right port ?
When an IP packet arrives on a router, the destination address is compared to the entries in the routing table. The router goes through all of the routing entries in the routing table and attempts to match it to a particular entry. If there are multiple entries that the destination IP address can match with, the following criteria are used:
First, the more specific entry is matched. In other words, the entry with the smallest subnet mask is used.
If the subnet mask is the same, then the entry with the lowest metric is used.
If the metric is the same, then load balancing takes place.
Note that one would assume that the administrative distance (AD) also plays a role, and it does, but not in the choice of installed routes. The AD will be used to determine if a route will be installed in the routing table in the event that two identical routes, with identical prefix lengths, are learned from different sources. If this happens, the route with the lower AD will be installed. The other route will never be in the routing table, thus it is never an option for a packet coming into the router. See this Cisco documentation for more info.
Now, if we apply this to your case, you would have the following two entries in your routing table:
18.104.22.168/27 as connected
22.214.171.124/32 as static with a next-hop to a particular interface
Now, in this case, the prefix of the static route is more specific, therefore that static route will be matched. In this case, you should not use Null0 as the next-hop IP since any packets destined to this IP will simply be dropped. Use an exit interface to ensure that such packets will be routed correctly.
Once that static route is entered with a next-hop interface, that entry is in the routing table, therefore BGP will be able to advertise it.
Excellent, I already tried the discarded route ( Null0 ) option and now I am able to advertising the /32 to BGP peer. Will have to wait and see how the traffic is flowing between this particular server and the customer over the BGP link.
HI my edge rotuer is connected ti isp
isp side ip address- 126.96.36.199
how we are getting below default route in bgp. Please help me to understand
Route Distinguisher: 20309:2 (default for vrf INET) VRF Router ID 188.8.131.52
*> 0.0.0.0 184.108.40.206
Routing Table: NET
Routing entry for 0.0.0.0/0, supernet
Known via "bgp 65400", distance 20, metric 0, candidate default path
Tag 17231, type external
Redistributing via eigrp 65401
Advertised by eigrp 65400 metric 1000000 1 255 1 1500
Last update from 220.127.116.11 7w0d ago
Routing Descriptor Blocks:
* 18.104.22.168 , from 22.214.171.124, 7w0d ago
Route metric is 0, traffic share count is 1
AS Hops 2
Route tag 17232
MPLS label: none
It looks like your local router has learned about the default route via “bgp 65400”. Is that the AS of the ISP? If that is the case, then BGP has advertised this default route to your router. It is possible to advertise a default route using BGP. To find out more about that, take a look at this post:
If you require more insight, it would be helpful if you showed us the full output of the BGP table as well as your BGP configuration.
A default route in BGP can be learned in a couple of ways. It can be configured as a static route in the routing table and then it can be injected into BGP using the network command, or it can be redistributed either from a static route in the routing table or from another routing protocol. In the second case, you will require the use of the default-originate keyword in your BGP neighbor command. More info on this can be found at the BGP advertising a default route NetworkLessons note.
I suggest you share your BGP configuration with us as well as your routing table, your EIGRP configuration, and any static routes you have configured. This way we’ll be able to help you further.
I just wanted to ask regarding with one of your lessons in BGP. You said If you advertise a network 126.96.36.199 mask 255.0.0.0 on R1 it will not work since this entry is not in the routing table but the thing is, this is a parent route right? cause if I type show ip route it shows the following:
188.8.131.52/8 is variably subnetted, 2 subnets, 2 masks
C 184.108.40.206/24 is directly connected, Loopback0
L 220.127.116.11/32 is directly connected, Loopback0
So should this be work then? Appreciate your response
When dealing with routing, a black hole is a term used to refer to a situation where network traffic or packets are dropped or lost without any notification or error message being sent back to the sender. Specifically, this can occur when a router receives traffic for a destination network that it cannot route or forward.
Instead of returning an error message to the sender indicating the destination is unreachable, the router discards the packets, creating a “black hole” where traffic goes in but never comes out.
There are various reasons that this can occur, including routing misconfiguration or device failure. One way to create a black hole manually is to create a null route. Any traffic destined for the network in the null route will simply be dropped.
Now in the case of the null route in this lesson, it doesn’t create a black hole. Why? Because the null route doesn’t actually route any traffic! If it did, it would be a black hole. The null route here serves as a way to advertise a network to its neighbors using BGP.
So by using the null route to 18.104.22.168/8 in R1, R2 learns about it. When R2 wants to send traffic to 22.214.171.124 for example, it will know to send such traffic to R1. When R1 receives it, it’s not the null route that routes the traffic, but the more specific route that matches 126.96.36.199/24.
Now if R2 wants to send traffic to a destination of 188.8.131.52, then yes, that would be sent to R1 and a black hole would be created. But that’s where network engineers should be smart about how they create null routes and what networks they include.
The best practice for advertising networks into BGP largely depends on your specific network design and requirements. Both the network and redistribute commands have their uses, but they operate differently.
The network command in BGP is used to advertise networks that are already present in the routing table. It’s a good practice to use this command when you want to have granular control over which routes are being advertised. This method requires more configuration as you would need to manually specify each network that you wish to advertise.
On the other hand, the redistribute command is used to take routes from other routing protocols and inject them into BGP. This is a more automated way of advertising routes, as it doesn’t require manual configuration for each network. Although the redistribute command requires that the redistributed prefixes be in the routing table, it doesn’t require an exact match as the network command does. However, it can potentially lead to the advertisement of unwanted routes if not properly controlled, which may cause routing loops or other issues.
Keep in mind that using the ‘redistribute’ command without proper route filtering can lead to the propagation of unnecessary routes, which can increase the size of the routing table and use more resources. It could also inadvertently advertise routes that you do not want to advertise.
So, if you have a small to medium-sized network where you can easily manage and control all your routes, you might prefer using the ‘network’ command. If you have a large network with many dynamic routes, then ‘redistribute’ might be more efficient, but you should be careful to apply appropriate filtering.
Always consider your network’s specific requirements and constraints when choosing between these methods.
Great info, I have 3 routers in location A peering with a WAN link that connects to another router in location B. The router in location B is peering with the ISP router. How would I advertise the default route in my entire network using BGP? Do I need to statically add it to the routing table first in order for BGP to advertise it? Is this my only option. Thanks