cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4319
Views
6
Helpful
24
Replies

Advertised /32 in /24 LAN subnet

jean1
Level 1
Level 1

Hello,


I am trying to do a basic thing but it's not working.

 

I would like to adverstived only IP address that is included in my LAN subnet. 198.168.10.1


Example :


interface GigabitEthernet0/0/0.10
encapsulation dot1Q 10
ip address 198.168.10.1 255.255.255.0

!


My test configuration :


ip route 198.168.10.1 255.255.255.255 null0 tag20

!

router bgp 64XXX
address-family ipv4

network 198.168.10.1 mask 255.255.255.255

!

OR


route-map STATIC permit 10

match tag 20

!

router bgp 64XXX
address-family ipv4

redistribute static route-map STATIC

!

Nothing is working !


Note : if i shut interface GigabitEthernet0/0/0.10, my /32 is advertised :

(Beacause AD Connected=0 and STATIC=1, I think )


Router#sh ip bgp nei 10.1.1.1 advertised-routes
*> 198.168.10.1/32 0.0.0.0 0 32768 i

 

Do you know if it's possible to advertised only IP included in connected interface ?

 

24 Replies 24

 

Rick 

 

The static route to null0 obviously works because if the interface is shut down then it is used and the BGP advertisement works. 

 

I am guessing that the L entry in the route table is not actually considered by BGP when looking for matching routes so it won't work for the IP assigned to the interface but you could advertise out any other IP using a static route in that subnet. 

 

Jon

That answer your Q why null0 not advertise.
the answer is route not use static route in routing table because it have already connect one.
and BGP not advertise the static route because it not appear in routing table.

Jon Marshall
Hall of Fame
Hall of Fame

 

The question is why does the L entry in the route table for 192.168.10.1 not allow a matching "network 192.168.10.1 mask 255.255.255.255" to be advertised out. 

 

Whereas when the interface is shut down then the static route to null0 is used and the prefix is advertised. 

 

Don't have any kit to test with at the moment but it would appear to be something to do with the L route in the routing table. 

 

Jon

""""Do this in LAB before apply it.""""
Your network is /24 and include all subnet from /24 until /32
if we config null0 /32 this will conflict with L for C of /24 
but if we config null0  /30
the DC peer will receive /24 and /30 and select the longest which is /30 
send traffic to Edge router you want to handle traffic, 
from there the edge router have null0 /30 and L /32 and it will select longest and forward traffic to L /32 "no black hole".

Hello MHM

 

After some tests, If we configure a /30 or /31, it work. But it never works if you try to advertise the physical IP address in /32.

 

interface GigabitEthernet0/0/0.10
ip address 192.168.10.1 255.255.255.0
!
ip route 192.168.10.0 255.255.255.254 Null0
ip route 192.168.10.0 255.255.255.252 Null0
ip route 192.168.10.1 255.255.255.255 Null0
ip route 192.168.10.2 255.255.255.255 Null0
ip route 192.168.10.3 255.255.255.255 Null0

 

Router#sh ip route 192.168.10.0
Routing entry for 192.168.10.0/24, 6 known subnets
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0/0.10
S 192.168.10.0/30 is directly connected, Null0
S 192.168.10.0/31 is directly connected, Null0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0/0.10
S 192.168.10.2/32 is directly connected, Null0
S 192.168.10.3/32 is directly connected, Null0

!
Router#sh ip bgp nei 10.1.1.1 advertised-routes 
Network Next Hop Metric LocPrf Weight Path

*> 192.168.10.0/31 0.0.0.0 0 32768 i
*> 192.168.10.0/30 0.0.0.0 0 32768 i
*> 192.168.10.2/32 0.0.0.0 0 32768 i
*> 192.168.10.3/32 0.0.0.0 0 32768 i

 

ALL IP addresses can be advertised, with the exception of the physical IP address.

 

 

Yes unfortunately because BGP check routing table before advertise any prefix, and since there is L /32 then it advertise it C /24 and not advertise Null0 
whenever you deal with BGP 
do to see how router inject this route in RIB.
show ip route ...... longest

Hello Jon

The question is why does the L entry in the route table for 192.168.10.1 not allow a matching "network 192.168.10.1 mask 255.255.255.255" to be advertised out. 

 

Whereas when the interface is shut down then the static route to null0 is used and the prefix is advertised. 

Isn't it something like this:
Local- shows an interfaces host address when it is active 
Connected - shows an interfaces network address of the L when it is active 

 

Lasty the static route to null is not really attached to any physically interface , but a logical one so it can be entered into the rib


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

 

Paul 

 

It may well be as you say, the Local entry does not count as a network entry in the routing table so BGP cannot use it as a match, it is the only explanation that makes sense. 

 

Jon

I am still not clear why the original poster wants to advertise the interface IP addresses but not advertise the subnet. And I wonder if we understood the objective if we might find a better solution. But for now the question is how to advertise the interface IP address but not the subnet. I believe that there are two solutions that achieve that (at least sort of).

1) Have R1 configure a static route with null 0 for the IP address of R2 and advertise it. Have R2 configure a static route with null 0 for the IP address of R1 and advertise it. That way the DC learns the interface IP addresses but not the subnet. The path from DC to R1 would not be the optimum path (that is the "sort of" in the solution that it would go through R2 to get to R1). But I think it does achieve the objective.

2) Have R1 and R2 do a redistribute connected (with appropriate filter of the advertisement so it is only the desired interface that is advertised).

HTH

Rick

Your question shows an interesting (and unexpected) behavior. I am glad that our explanations have been helpful. Thank you for marking this question as solved. This will help other participants in the community to identify discussions which have helpful information. This community is an excellent place to ask questions and to learn about networking. I hope to see you continue to be active in the community.

HTH

Rick
Review Cisco Networking for a $25 gift card