06-22-2009 09:29 AM - edited 03-04-2019 05:12 AM
I have a question on BGP. I have a router speaking BGP to multiple neighbors. It is generating a default route using 'default-originate' command to all of its neighbors. I would like to have some neighbors stop receiving this default route. How can I filter this default route on a particular neighbor.
06-22-2009 09:42 AM
use neighbor x.x.x.x default-originate instead under router bgp.
06-22-2009 10:05 AM
The task I would like to do is to remove the all 0.0.0.0 entries learned from BGP on this particular router:
Router A#sh ip bgp
BGP table version is 14, local router ID is 2.2.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* 0.0.0.0 5.5.5.1 0 6533 6511 6511 i
*> 5.5.5.1 0 0 6511 6511 i
r 1.1.1.0/24 5.5.5.1 0 6533 6511 i
r> 5.5.5.1 0 0 6511 i
r 1.1.2.0/24 5.5.5.1 0 6533 6511 i
r> 5.5.5.1 0 0 6511 i
*> 2.2.1.0/24 0.0.0.0 0 32768 i
*> 2.2.2.0/24 0.0.0.0 0 32768 i
*> 10.10.1.0/24 5.5.5.3 0 0 6533 i
* 5.5.5.3 0 6511 6533 i
*> 10.10.2.0/24 5.5.5.3 0 0 6533 i
* 5.5.5.3 0 6511 6533 i
r 30.30.2.0/24 5.5.5.1 0 6533 6511 i
r> 5.5.5.1 156160 0 6511 i
*> 70.70.70.0/24 5.5.5.3 25753600 0 6533 i
* 5.5.5.3 0 6511 6533 i
*> 222.222.222.0 5.5.5.3 0 0 6533 i
Router A#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 5.5.5.1 to network 0.0.0.0
200.200.200.0/30 is subnetted, 1 subnets
C 200.200.200.0 is directly connected, Serial0/0/1:0
B 222.222.222.0/24 [100/0] via 5.5.5.3, 00:05:57
C 211.211.211.0/24 is directly connected, GigabitEthernet0/1
1.0.0.0/24 is subnetted, 2 subnets
D 1.1.1.0 [90/156160] via 211.211.211.1, 03:37:37, GigabitEthernet0/1
D 1.1.2.0 [90/156160] via 211.211.211.1, 03:37:37, GigabitEthernet0/1
D EX 222.222.100.0/24
[170/30720] via 211.211.211.4, 01:49:46, GigabitEthernet0/1
2.0.0.0/24 is subnetted, 2 subnets
C 2.2.1.0 is directly connected, Loopback0
C 2.2.2.0 is directly connected, Loopback1
100.0.0.0/30 is subnetted, 1 subnets
C 100.100.100.0 is directly connected, Serial0/0/0:0
70.0.0.0/24 is subnetted, 1 subnets
B 70.70.70.0 [100/25753600] via 5.5.5.3, 00:05:59
80.0.0.0/24 is subnetted, 2 subnets
D 80.80.1.0 [90/156160] via 211.211.211.4, 03:37:40, GigabitEthernet0/1
D 80.80.2.0 [90/156160] via 211.211.211.4, 03:37:40, GigabitEthernet0/1
5.0.0.0/24 is subnetted, 1 subnets
C 5.5.5.0 is directly connected, GigabitEthernet0/0
111.0.0.0/30 is subnetted, 1 subnets
D 111.111.111.0
[90/2181120] via 211.211.211.3, 03:36:22, GigabitEthernet0/1
[90/2181120] via 211.211.211.1, 03:36:22, GigabitEthernet0/1
10.0.0.0/24 is subnetted, 2 subnets
B 10.10.1.0 [100/0] via 5.5.5.3, 00:05:59
B 10.10.2.0 [100/0] via 5.5.5.3, 00:05:59
30.0.0.0/24 is subnetted, 2 subnets
D 30.30.1.0 [90/156160] via 211.211.211.3, 03:36:24, GigabitEthernet0/1
D 30.30.2.0 [90/156160] via 211.211.211.3, 03:36:24, GigabitEthernet0/1
B* 0.0.0.0/0 [100/0] via 5.5.5.1, 00:06:00
Alameda#
06-22-2009 10:51 AM
create a filter list:
Something like this should work.
router bgp ASN
neighbor x.x.x.x route-map IN in
!
ip prefix-list IN seq 5 deny 0.0.0.0/0
!
route-map IN permit 10
match ip address prefix-list IN
06-22-2009 11:25 AM
Hello Rick,
good idea I would refine it in this way:
ip prefix-list def_route seq 5 permit 0.0.0.0/0
route-map IN deny 10
match ip address prefix-list def_route
+
route-map IN permit 20
to allow all other prefixes learned from the neighbor without the second clause all prefixes are denied.
Hope to help
Giuseppe
06-22-2009 12:15 PM
Your solution is great. It works for me.
I was running into the problem that you described. Without the second clause on the route-map, all prefixes will be denied.
Thank you all.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: