cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2678
Views
25
Helpful
11
Replies

Redistribute route via BGP that aren't in routing table

PierreOlivier_M
Level 1
Level 1

I would like to know if you know a way to redistribute in BGP routes in /32 but which are not present in the routing table.

 

Let's take an example:
I have an interface addressed in 192.168.1.254/24.
Connected directly to this interface I have several machines that are in 192.168.1.X (they have learned their IP via DHCP request, ie my interface that has the IP 192.168.1.254 acts as dhcp relay).

 

So let's say I have 3 machines that have learned the IPs 192.168.1.4, 192.168.1.26 and 192.168.1.164.


These IPs are not in the routing table because they are link to a directly connected interface of my router (my only way to get them is via ARP).

 

My goal is to redistribute these 3 routes via BGP :
192.168.1.4/32
192.168.1.26/32
192.168.1.164/32


Is there a way to do it? Other than creating static routes (not possible in my case because I don't know the IPs that are dynamically assigned), or maybe a way to generate static route automatically ?
Or is this totally utopian?

 

Don't hesitate to ask me if you need more details.

11 Replies 11

Why do you need the /32 routes in the routing table when you already have a /24 to that network?

To tell the truth, this is simply to gain IP.
Let's imagine that I have several clients that come to pick IPs in the same DHCP pool (I can't subnet the pool otherwise I would lose too many IPs and that would force me to limit my number of future clients).

These clients are each in a different VRF, and the goal is to get routes that will lead to the right VRF depending on the destination IP.
That's why I can't announce a /24 directly but each VRF must only announce the /32 it has.

I hope this is understandable.

Georg Pauwen
VIP Alumni
VIP Alumni

Hello,

 

how many ARP entries belonging to that 192.168.1.0 network are in the ARP table, just these three ? If so, an EEM script could extract these, convert them into static host routes, and subsequently redistribute them into BGP...

When I read the original post my first reaction was to remember the basics - that BGP can not advertise a route that is not in the routing table. The solution suggested by @Georg Pauwen is very creative and possibly a way to achieve the result that BGP could advertise the routes. But as I think about this solution 2 difficulties occur to me:

1) what if there are other devices in that subnet?

2) after the eem script has added some static routes, what would happen if one (or more) of the devices is assigned a different IP address? The eem script could recognize the new address and create a new static route. But what about the static route already created? Would it just remain in the routing table and still redistributed into BGP?

And I think the question from @Elliot Dierksen is something to think about? If you can advertise the /24 then why do you need individual /32 routes?

HTH

Rick

Actually this number can vary regularly (this is related to the addition/removal of customers).
An EEM script can indeed be a solution but it means that it will have to be launched at each addition/removal which is not necessarily optimal in my case.

But I keep it in the back of my mind !

Hello,

 

I am just thinking: why not create a null route for all IP addresses in the subnet, and then redistribute the static host routes proactively ? That way, any possible host route is already in the routing table, regardless of any change of IP address.

 

Just a thought...

I am trying to understand what the goal is and there is a question that occurs to me: if there are multiple clients, each of whom gets an IP address using DHCP, and if there are multiple VRFs (one per client?) how will you know which client is which so that you get an IP into the right VRF?

HTH

Rick

The allocation at the DHCP level is static which allows us to identify the clients. Now you might say "so why don't you just add a static route at the same time you configure DHCP", the answer is that adding new clients and managing the core network is not done by the same teams and having something automated at the core level would be more convenient.

 

PO

 

If it was me I would just use a script to allocate the DHCP static IP and at the same time add the static route to the router and obviously removal of a DHCP IP could also remove the corresponding route. 

 

Separating the functions to be run by separate teams is just a recipe for inconsistency. 

 

Jon

 

 

I quite agree with you and it's quite likely that in the end it will end up like this.

But nothing prevents me from asking if someone has already had this situation and used a ploy that I don't know (I like to learn new things).

 

PO

Mahmoud Elsoury
Level 1
Level 1

Create /32 static routes for all IP addresses you need with their track objects (IP SLA) and redistribute static

This is a work around but not sure why are you trying to get from this