cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2539
Views
0
Helpful
6
Replies

BGP: Advertise a smaller subnet

tinhnho123
Level 2
Level 2

Hi Guys,

We're given a subnet 172.20.0.0/23 and  we're told that we need to advertise whole subnet /23 to the ISP so I create a static route with Null 0. Below is my eBGP router setup with my ISP.

 

Router A:

    ip route 172.20.0.0/23 null 0

 

    router bgp 12345

       neighbor 207.12.12.x remote-as 34567

       network 172.20.0.0 mask 255.255.254.0

 

     interface g1/0

         ip address 172.20.1.1 mask 255.255.255.0

 

How do I make sure that 172.20.0.0/23 is still advertised to my ISP but only 172.20.1.0/24 is allowed to access the internet and not the rest? 

 

Thanks.

  

 

1 Accepted Solution

Accepted Solutions

Hello,

 

most ISPs will accept /24 prefixes but nothing smaller. They prefer /23 because it keeps their (and the global) routing table smaller...

View solution in original post

6 Replies 6

Hello,

 

since your ISP won't accept the /24 route, the easiest option would be to advertise the /23 route and use an access list on the outgoing interface to allow only the /24:

 

interface GigabitEthernet0/0

description Link to ISP

access-group 101 in

!

access-list 101 permit ip 172.20.0.0 255.255.255.0 any

 

Can I use prefix list and route-map in this case instead of ACL? Thanks.

Hello,

 

that would work, too.

 

route-map 24_PREFIX_RM permit 10
match ip address prefix-list 24_PREFIX_LIST
set interface GigabitEthernet0/0
!

route-map 24_PREFIX_RM deny 20
ip prefix-list 24_PREFIX_LIST permit 172.20.0.0/24

 

Apply this to your LAN interface, e.g.:

 

interface GigabitEthernet0/1

description LAN

ip policy route-map 24_PREFIX_RM

Thanks alot!

 

I've called the ISP and able to speak with their engineers if they accept /24 or not, they all confirmed that they do accept /24 but neither of them was able to answer me why they wanted me to advertise /23 to the bgp. Do you happen to know the reason behind that? Thanks again.

Hello,

 

most ISPs will accept /24 prefixes but nothing smaller. They prefer /23 because it keeps their (and the global) routing table smaller...

Thanks!

Review Cisco Networking products for a $25 gift card